Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Closed
MaxKellermann wants to merge 4 commits into php:master from CM4all:link_cxx

Conversation

Copy link
Contributor

@MaxKellermann MaxKellermann commented Feb 22, 2023

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++.

talyssonlima reacted with thumbs up emoji
Merge lots of duplicate code from sapi/*/config.m4. All
Darwin-specific cases have been eliminated there.
Copy link
Contributor Author

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.
Copy link
Contributor Author

MaxKellermann commented Feb 22, 2023
edited
Loading

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)

Copy link
Member

Looks correct changes to me but prefer to double check with someone more accustomed to

Copy link
Member

I don't know much about C++ or the linker, so I'm probably not the right guy to review this one.

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

@iluuu1994 iluuu1994 Awaiting requested review from iluuu1994

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /