From dbc3ff850b7829fde2265b5311016b6d0f1d41ab Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Wed, 16 Oct 2024 10:56:52 +0100 Subject: [PATCH] Check if compiler supports -fstack-clash-protection Similar to #2202, check if the host compiler supports the `-fstack-clash-protection` flag rather than using version ranges. --- cmake/helpers.cmake | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cmake/helpers.cmake b/cmake/helpers.cmake index 8b40da7d4c..69efdcca25 100644 --- a/cmake/helpers.cmake +++ b/cmake/helpers.cmake @@ -59,6 +59,7 @@ macro(add_sanitizer_flag flag) endmacro() check_cxx_compiler_flag("-fcf-protection=full" CXX_HAS_FCF_PROTECTION_FULL) +check_cxx_compiler_flag("-fstack-clash-protection" CXX_HAS_FSTACK_CLASH_PROTECTION) function(add_ur_target_compile_options name) if(NOT MSVC) @@ -81,9 +82,7 @@ function(add_ur_target_compile_options name) # -flto # $<$:-fsanitize=cfi> $<$:-fcf-protection=full> - # -fstack-clash-protection is not supported in apple clang or GCC < 8 - $<$,$,8>>:-fstack-clash-protection> - $<$:-fstack-clash-protection> + $<$:-fstack-clash-protection> # Colored output $<$:-fdiagnostics-color=always>