[compiler-rt] 0cca9e4 - [compiler-rt] Remove enable_execute_stack support on arm64 Darwin (#158386)

via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 15 07:55:41 PDT 2025


Author: Akira Hatanaka
Date: 2025-09-15T07:55:37-07:00
New Revision: 0cca9e4baa0073a5a6f46b1b09dbd6ed290ae619

URL: https://github.com/llvm/llvm-project/commit/0cca9e4baa0073a5a6f46b1b09dbd6ed290ae619
DIFF: https://github.com/llvm/llvm-project/commit/0cca9e4baa0073a5a6f46b1b09dbd6ed290ae619.diff

LOG: [compiler-rt] Remove enable_execute_stack support on arm64 Darwin (#158386)

`enable_execute_stack` is not supported on arm64 Darwin because:

- It calls mprotect with `PROT_WRITE | PROT_EXEC`, which is rejected on
this platform.
- It assumes a fixed 4K page size, which is not guaranteed.

This change disables building `enable_execute_stack` on arm64 Darwin and
fixes the failing test:

`compiler-rt/test/builtins/Unit/enable_execute_stack_test.c`.

rdar://159705691

Added: 
    

Modified: 
    compiler-rt/lib/builtins/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt
index 1dadb6a810efb..0d7fc65cfd3e9 100644
--- a/compiler-rt/lib/builtins/CMakeLists.txt
+++ b/compiler-rt/lib/builtins/CMakeLists.txt
@@ -674,6 +674,11 @@ if (MINGW)
   )
 endif()
 
+# Don't build enable_execute_stack on arm64 darwin.
+if (APPLE)
+  list(REMOVE_ITEM aarch64_SOURCES enable_execute_stack.c)
+endif()
+
 set(amdgcn_SOURCES ${GENERIC_SOURCES})
 
 set(armv4t_SOURCES ${arm_min_SOURCES})


        


More information about the llvm-commits mailing list