Skip to content

Commit 509e766

Browse files
committed
fixup! cmake: Add HARDENING option
1 parent 15faf0b commit 509e766

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

CMakeLists.txt

+7
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,13 @@ if(HARDENING)
267267
try_append_cxx_flags("-fcf-protection=full" TARGET hardening_interface)
268268

269269
if(MINGW)
270+
# Older versions of gcc required libssp to be linked, but this was fixed
271+
# with gcc-11. This can be removed when those older versions are no longer
272+
# supported.
273+
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.0)
274+
target_link_libraries(hardening_interface INTERFACE ssp)
275+
endif()
276+
270277
# stack-clash-protection doesn't compile with GCC 10 and earlier.
271278
# In any case, it is a no-op for Windows.
272279
# See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90458 for more details.

0 commit comments

Comments
 (0)