Skip to content

Commit 6db9551

Browse files
iluuu1994petk
andcommitted
Disable JIT on Apple Silicon + ZTS
Apple Silicon has stricter rules about rwx mmap regions. They need to be created using the MAP_JIT flag. However, the MAP_JIT seems to be incompatible with MAP_SHARED. ZTS requires MAP_SHARED so that some threads may execute code from a page while another writes/appends to it. We did not find another solution, other than completely disabling JIT for Apple Silicon + ZTS. See discussion in #13351. Co-authored-by: Peter Kokot <peterkokot@gmail.com> Fixes GH-13400 Closes GH-13396
1 parent c2b671c commit 6db9551

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ext/opcache/config.m4

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ if test "$PHP_OPCACHE" != "no"; then
3636
PHP_OPCACHE_JIT=no
3737
;;
3838
esac
39+
if test "$host_vendor" = "apple" && test "$host_cpu" = "aarch64" && test "$PHP_THREAD_SAFETY" = "yes"; then
40+
AC_MSG_WARN([JIT not supported on Apple Silicon with ZTS])
41+
PHP_OPCACHE_JIT=no
42+
fi
3943
fi
4044

4145
if test "$PHP_OPCACHE_JIT" = "yes"; then

0 commit comments

Comments
 (0)