aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2024-03-20 14:39:41 +0000
committerfanquake <fanquake@gmail.com>2024-09-13 11:26:40 +0100
commit001b1cf010453adbb1316a6fa8911398953afe61 (patch)
tree0e1396dcae113306fb49d469f902e1144aa3d028
parentcf0120ff024aa73a56f2975c832fda6aa8146dfa (diff)
build: use standard branch-protection for aarch64-linux
-rw-r--r--CMakeLists.txt6
1 files changed, 5 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 555e5b99b7..b8fdeefbda 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -506,7 +506,11 @@ if(ENABLE_HARDENING)
endif()
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
- try_append_cxx_flags("-mbranch-protection=bti" TARGET hardening_interface SKIP_LINK)
+ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+ try_append_cxx_flags("-mbranch-protection=bti" TARGET hardening_interface SKIP_LINK)
+ else()
+ try_append_cxx_flags("-mbranch-protection=standard" TARGET hardening_interface SKIP_LINK)
+ endif()
endif()
try_append_linker_flag("-Wl,--enable-reloc-section" TARGET hardening_interface)