Skip to content

Commit c54f9e1

Browse files
committed
fixup! cmake: Add HARDENING option
1 parent d5752a1 commit c54f9e1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,10 @@ if(HARDENING)
316316
)
317317

318318
try_append_cxx_flags("-Wstack-protector" TARGET hardening_interface)
319+
# The -fstack-protector-all option might impact the linking stage as well.
320+
# Hence, it should be applied to both the compilation and linking stages.
319321
try_append_cxx_flags("-fstack-protector-all" TARGET hardening_interface)
322+
try_append_linker_flag("-fstack-protector-all" TARGET hardening_interface)
320323
try_append_cxx_flags("-fcf-protection=full" TARGET hardening_interface)
321324

322325
if(MINGW)

0 commit comments

Comments
 (0)