Skip to content
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

cmake: Check -D_FORTIFY_SOURCE before applying #286

Merged
merged 1 commit into from
Jul 30, 2024

Conversation

hebasto
Copy link
Owner

@hebasto hebasto commented Jul 26, 2024

Check -D_FORTIFY_SOURCE before applying.

This PR follows the master branch behaviour.

@hebasto
Copy link
Owner Author

hebasto commented Jul 26, 2024

This PR addresses @fanquake's offline comment:

Is there a reason we don't actually test _FORTIFY_SOURCE with a compile, and currently just assume it works & add it to the hardening interface?

@hebasto hebasto added the bug Something isn't working label Jul 26, 2024
Check `-D_FORTIFY_SOURCE` before applying.
@hebasto hebasto changed the title cmake: Check -D_FORTIFY_SOURCE before applying. cmake: Check -D_FORTIFY_SOURCE before applying Jul 29, 2024
@m3dwards
Copy link

ACK e88bfeb

I can see in the configure output that the flags have been set and I saw in CMakeConfigureLog.yaml that they were correctly passed to compiler and linker to check that there are no warnings with their use.

/usr/bin/c++ -DCXX_SUPPORTS__U_FORTIFY_SOURCE__D_FORTIFY_SOURCE_3  -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -Werror -std=c++20 -fPIC -o CMakeFiles/cmTC_26374.dir/src.cxx.o -c /bitcoin/build/CMakeFiles/CMakeScratch/TryCompile-0M3Cih/src.cxx

@hebasto hebasto merged commit d41a407 into cmake-staging Jul 30, 2024
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants