Skip to content

Comments

configure: add --with-cxx-stdlib option#74

Open
yuxuanchen1997 wants to merge 1 commit intofacebook:devfrom
yuxuanchen1997:ych/with-cxx-stdlib
Open

configure: add --with-cxx-stdlib option#74
yuxuanchen1997 wants to merge 1 commit intofacebook:devfrom
yuxuanchen1997:ych/with-cxx-stdlib

Conversation

@yuxuanchen1997
Copy link
Member

When C++ support is enabled, configure unconditionally probes -lstdc++ and keeps it in LIBS if the link test succeeds. On platforms using libc++, this probe can succeed at compile time (if libstdc++ headers/libraries happen to be installed) but then cause runtime failures when configure tries to execute test binaries because libstdc++.so.6 isn't actually available.

Add a --with-cxx-stdlib=<libstdc++|libcxx> option that lets the build system specify which C++ standard library to link. When given, the probe is skipped and the specified library is linked directly. When not given, the original probe behavior is preserved.

When C++ support is enabled, configure unconditionally probes
`-lstdc++` and keeps it in LIBS if the link test succeeds. On
platforms using libc++, this probe can succeed at compile time (if
libstdc++ headers/libraries happen to be installed) but then cause
runtime failures when configure tries to execute test binaries
because `libstdc++.so.6` isn't actually available.

Add a `--with-cxx-stdlib=<libstdc++|libcxx>` option that lets the
build system specify which C++ standard library to link. When given,
the probe is skipped and the specified library is linked directly.
When not given, the original probe behavior is preserved.
@meta-cla meta-cla bot added the cla signed label Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant