-
Notifications
You must be signed in to change notification settings - Fork 7.9k
use C++ compiler for linking, replaces -lstdc++
#10663
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Merge lots of duplicate code from sapi/*/config.m4. All Darwin-specific cases have been eliminated there.
This is a possible fix for #10641 (comment) (sanitizers currently broken with C++)
If at least one source is C++, ask the C++ compiler to link the executable instead of manually adding `-lstdc++`. The C++ compiler knows best which C++ standard library needs to be used. This is more robust, and allows non-GNU standard libraries such as libc++.
Without this, the sanitizers are disabled on C++ sources.
7787c04
to
8ca9613
Compare
macOS failure due to a bug in this PR
ASAN failure due to bug in configure.ac
(see my php-internals thread). Trying to work around this by adding sanitizer flags to CXXFLAGS
(cherry-picked from #10641)
Looks correct changes to me but prefer to double check with someone more accustomed to
I don't know much about C++ or the linker, so I'm probably not the right guy to review this one.
If at least one source is C++, ask the C++ compiler to link the executable instead of manually adding
-lstdc++
. The C++ compiler knows best which C++ standard library needs to be used. This is more robust, and allows non-GNU standard libraries such as libc++.