diff options
author | fanquake <fanquake@gmail.com> | 2024-03-20 14:39:41 +0000 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2024-09-13 11:26:40 +0100 |
commit | 001b1cf010453adbb1316a6fa8911398953afe61 (patch) | |
tree | 0e1396dcae113306fb49d469f902e1144aa3d028 | |
parent | cf0120ff024aa73a56f2975c832fda6aa8146dfa (diff) |
build: use standard branch-protection for aarch64-linux
-rw-r--r-- | CMakeLists.txt | 6 |
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) |