Skip to content

Opcache bug again in main branch #667

@crazywhalecc

Description

@crazywhalecc
Owner
          > I can reproduce this 8.3 bug locally on my debian vm, seems it's a linking dynamic libstdc++.so bug. But I have no idea why opcache happen to get this error.

Hmmm intresting. I finally found which extension caused it. When I build opcache alone, it's ok. But when I build opcache,intl or opcache,imagick, it failed in ./configure. But opcache,swoole is working, that's weird.

If it is just because of the error of libstdc++.so, then swoole should not compile successfully. But when I realized that intl and imagick have letters before opcache, and swoole has letters after opcache, then this makes sense. And I renamed ext/swoole to ext/aswoole, it failed as expected.

But why does the 8.3 opcache extension incorrectly use libstdc++.so when including C++ dependencies instead of the other libraries? In theory we would only manually insert -lstdc++ at the final make step.

Also, if I use the opcache,imagick combination, it has not only libstdc++, but also libgomp (libgomp is added here

$extra_libs .= (empty($extra_libs) ? '' : ' ') . '-lgomp ';
)

configure:70964: checking for sysvipc shared memory support
configure:71038: x86_64-linux-musl-gcc -o conftest  -fPIE -ffp-contract=off -fvisibility=hidden -pthread -I/home/jerry/project/static-php-cli/buildroot/include -D_GNU_SOURCE -D_REENTRANT -L/home/jerry/project/static-php-cli/buildroot/lib -Wl,-rpath,/home/jerry/project/static-php-cli/buildroot/lib/pkgconfig/../../lib -L/home/jerry/project/static-php-cli/buildroot/lib/pkgconfig/../../lib -Wl,-rpath,/home/jerry/project/static-php-cli/buildroot/lib -L/home/jerry/project/static-php-cli/buildroot/lib conftest.c -lgomp -lrt -lm -ldl -lpthread -lm -lpthread -lMagickWand-7.Q16HDRI -ltiff -ljpeg -lz -lm -ljpeg -lz -lfreetype -lpng16 -lz -ljpeg -lpng16 -lz -lheif -lstdc++ -lde265 -lstdc++ -laom -lm -ljpeg -lsharpyuv -lz -lbrotlidec -lbrotlicommon -lwebpmux -lwebpdemux -lwebp -lsharpyuv -lwebp -lsharpyuv -lxml2 -liconv -lm -licui18n -licuuc -licudata -lpthread -lm -lz -lzip -lbz2 -lssl -lcrypto -lz -lm -lpthread -lgomp -lm -lMagickCore-7.Q16HDRI -ltiff -ljpeg -lz -lm -ljpeg -lz -lfreetype -lpng16 -lz -ljpeg -lpng16 -lz -lheif -lstdc++ -lde265 -lstdc++ -laom -lm -ljpeg -lsharpyuv -lz -lbrotlidec -lbrotlicommon -lwebpmux -lwebpdemux -lwebp -lsharpyuv -lwebp -lsharpyuv -lxml2 -liconv -lm -licui18n -licuuc -licudata -lpthread -lm -lz -lzip -lbz2 -lssl -lcrypto -lz -lm -lpthread -lgomp -lm >&5
configure:71038: $? = 0
configure:71038: ./conftest
Error loading shared library libgomp.so.1: No such file or directory (needed by ./conftest)
Error loading shared library libstdc++.so.6: No such file or directory (needed by ./conftest)

Originally posted by @crazywhalecc in #622 (comment)

Related workflow runs:

Related PR:

Activity

henderkes

henderkes commented on Mar 20, 2025

@henderkes
Collaborator

Are you not setting LD_PRELOAD path for the spc configure option? It should find lstdc++ and lgomp in the musl paths.

crazywhalecc

crazywhalecc commented on Mar 21, 2025

@crazywhalecc
OwnerAuthor

@DubbleClick I realized that this might not be a problem with the stdc++ library, but perhaps a configuration bug in some extension that caused this check to include dependencies on other extensions. There shouldn't be any other dependencies here.

But it seems that this problem only occurs on macOS, so I may have missed something. It may be a lot of work to solve it from the original source.

crazywhalecc

crazywhalecc commented on Jul 23, 2025

@crazywhalecc
OwnerAuthor

Looks like we have no issue currently in main branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @henderkes@crazywhalecc

        Issue actions

          Opcache bug again in main branch · Issue #667 · crazywhalecc/static-php-cli