Skip to content

Commit 0cca9e4

Browse files
authored
[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
1 parent 32ab6ff commit 0cca9e4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

compiler-rt/lib/builtins/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,11 @@ if (MINGW)
674674
)
675675
endif()
676676

677+
# Don't build enable_execute_stack on arm64 darwin.
678+
if (APPLE)
679+
list(REMOVE_ITEM aarch64_SOURCES enable_execute_stack.c)
680+
endif()
681+
677682
set(amdgcn_SOURCES ${GENERIC_SOURCES})
678683

679684
set(armv4t_SOURCES ${arm_min_SOURCES})

0 commit comments

Comments
 (0)