We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 999c559 + c27cb7c commit e6206ceCopy full SHA for e6206ce
1 file changed
src/Hardening.cmake
@@ -19,7 +19,19 @@ function(
19
endif()
20
21
if(${ENABLE_STACK_PROTECTION})
22
- list(APPEND HARDENING_COMPILE_OPTIONS -fstack-protector-strong -fstack-clash-protection)
+ set(_enable_stack_clash_protection TRUE)
23
+ if (APPLE)
24
+ # `-fstack-clash-protection` dosen't work on MacOS M1 with clang
25
+ if(CMAKE_SYSTEM_PROCESSOR MATCHES "arm64" AND CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
26
+ set(_enable_stack_clash_protection FALSE)
27
+ endif()
28
29
+
30
+ if (_enable_stack_clash_protection)
31
+ list(APPEND HARDENING_COMPILE_OPTIONS -fstack-clash-protection)
32
33
34
+ list(APPEND HARDENING_COMPILE_OPTIONS -fstack-protector-strong)
35
36
37
if(${ENABLE_OVERFLOW_PROTECTION})
0 commit comments