cmake: Fix and improve hardening for Windows#74
Conversation
|
Friendly ping @fanquake @theuni @TheCharlatan :) |
586affa to
789f402
Compare
|
Rebased. |
67ceebb to
203a3ab
Compare
789f402 to
509e766
Compare
|
Rebased. |
theuni
left a comment
There was a problem hiding this comment.
ACK after addressing documentation comment.
| endif() | ||
|
|
||
| if(NOT HARDENING AND "@no_harden@" STREQUAL "1") | ||
| set(HARDENING OFF CACHE STRING "") |
There was a problem hiding this comment.
I was expecting to see this set hardening to true if not @no_harden@, but it's already the default in the main build. So it's doing the same thing as our config.site which makes sense.
509e766 to
78ff251
Compare
|
As it was mentioned during yesterday's meeting, if it won't hurt or have any significant drawbacks why not providing Or, even better, |
78ff251 to
cad5f28
Compare
ff2f574 to
dacc6f7
Compare
cad5f28 to
f89271c
Compare
|
Rebased. |
f89271c to
c54f9e1
Compare
c54f9e1 to
06fc8c6
Compare
|
This PR and its description have been updated per feedback from the recent call on 2024-02-01. |
Make added flags language-wide, which means they will be passed to all invocations of the compiler including both compiling and linking.
06fc8c6 to
d889870
Compare
|
LGTM |
0d985e5 fixup! cmake: Add `TryAppendCXXFlags` module (Hennadii Stepanov) Pull request description: This PR is a follow-up on #74. No need to try a flag in the linker context if it is not supported in the compiler context. For example, on the staging branch: ``` $ env CC=clang CXX=clang++ cmake -B build ... -- Performing Test CXX_SUPPORTS__FSTACK_REUSE_NONE -- Performing Test CXX_SUPPORTS__FSTACK_REUSE_NONE - Failed CMake Warning at cmake/module/TryAppendCXXFlags.cmake:125 (message): The -fstack-reuse=none fail(s) to link. Call Stack (most recent call first): CMakeLists.txt:310 (try_append_cxx_flags) ... ``` Top commit has no ACKs. Tree-SHA512: 6e73f00838eeb066635cbbf1acb41955b32a83e9939b1cabe62152b312d2e9c1f8dcacb6b11f529769b541925cc778d9e63e0968615ff4404a393115199300f5
Some compile flags, for example
-fstack-protector-all, might impact the linking stage as well. Instead of guessing, this PR makes thetry_append_cxx_flagsfunction add new flags in both compile and link contexts.