Skip to content

Commit 6ee20f1

Browse files
committed
opcache/jit support: Mac M1 build fic
unfortunately host_cpu is set only as `arm`. adding preprocessor ARM64APPLE for future use to be able to distinguish possibly from an usual arm64 board (e.g. not all same registers, x29/x30 vs fp/lr etc).
1 parent 81f660d commit 6ee20f1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ext/opcache/config.m4

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,15 @@ if test "$PHP_OPCACHE" != "no"; then
2222

2323
dnl Always build as shared extension
2424
ext_shared=yes
25+
uname_m=`uname -m 2>/dev/null`
2526

2627
if test "$PHP_HUGE_CODE_PAGES" = "yes"; then
2728
AC_DEFINE(HAVE_HUGE_CODE_PAGES, 1, [Define to enable copying PHP CODE pages into HUGE PAGES (experimental)])
2829
fi
2930

3031
if test "$PHP_OPCACHE_JIT" = "yes"; then
31-
case $host_cpu in
32-
i[34567]86*|x86*|aarch64)
32+
case $uname_m in
33+
i[34567]86*|x86*|aarch64|arm64)
3334
;;
3435
*)
3536
AC_MSG_WARN([JIT not supported by host architecture])
@@ -58,6 +59,10 @@ if test "$PHP_OPCACHE" != "no"; then
5859
x86*)
5960
DASM_ARCH="x86"
6061
;;
62+
arm*-*-darwin*)
63+
DASM_FLAGS="-D ARM64APPLE=1 -D ARM64=1"
64+
DASM_ARCH="arm64"
65+
;;
6166
aarch64*)
6267
DASM_FLAGS="-D ARM64=1"
6368
DASM_ARCH="arm64"

0 commit comments

Comments
 (0)