Skip to content

fix pgsql and other polyfill libs leaking into configure - #1236

Merged
henderkes merged 3 commits into
v3from
fix/pgport-configure
Aug 22, 2026
Merged

fix pgsql and other polyfill libs leaking into configure#1236
henderkes merged 3 commits into
v3from
fix/pgport-configure

Conversation

@henderkes

Copy link
Copy Markdown
Collaborator

currently when building pgsql on old glibc systems the polyfill libs from pgsql and libedit advertise strlcpy and strlcat as available, even though they only are when linking against those libs.

@henderkes
henderkes requested a review from crazywhalecc August 21, 2026 19:42
@henderkes
henderkes merged commit a488606 into v3 Aug 22, 2026
8 checks passed
@henderkes
henderkes deleted the fix/pgport-configure branch August 22, 2026 07:18
'CPPFLAGS' => "-I{$package->getIncludeDir()}",
'LDFLAGS' => "-L{$package->getLibDir()} " . getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS'),
'LIBS' => $vars['EXTRA_LIBS'] ?? '',
'LIBS' => SystemTarget::getRuntimeLibs(),

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@henderkes

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in my PR

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants