fix pgsql and other polyfill libs leaking into configure - #1236
Conversation
| 'CPPFLAGS' => "-I{$package->getIncludeDir()}", | ||
| 'LDFLAGS' => "-L{$package->getLibDir()} " . getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS'), | ||
| 'LIBS' => $vars['EXTRA_LIBS'] ?? '', | ||
| 'LIBS' => SystemTarget::getRuntimeLibs(), |
There was a problem hiding this comment.
The LIBS configuration in PHP's ./configure was downgraded from makeVars()['EXTRA_LIBS'] (the complete library, including -lstdc++/-lc++, -lssl -lcrypto, and frameworks) to SystemTarget::getRuntimeLibs() (only the basic runtime library).
Then, the conftest linker test in configure failed due to missing C++ runtime and OpenSSL symbols, causing some jobs crash with the error configure: error.
This leads to a regression problem.
There was a problem hiding this comment.
SystemTarget::getRuntimeLibs() should be returning -lstdc++ if we have any C++ extensions.
The problem with passing $vars['EXTRA_LIBS'] is passing all the polyfill libraries which will make php get wrong HAVE_XXX defines which will lead to make fail.
Are frameworks missing from getRuntimeLibs()? Then they need to be added. The implementation we have in main branch is correct.
currently when building pgsql on old glibc systems the polyfill libs from pgsql and libedit advertise
strlcpyandstrlcatas available, even though they only are when linking against those libs.