Skip to content

Commit e44b762

Browse files
committed
Fix GH-16839: Error on building Opcache JIT for Windows ARM64
OPcache JIT does not support Windows ARM64, so we should not allow `--enable-opcache-jit` in the first place. Due to the way `ARG_ENABLE()` is handled on Windows, we do not attempt to suppress the configure option, but just do not enable JIT when the user attempts to, and adapt the help text. Closes GH-16841.
1 parent e00d684 commit e44b762

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

NEWS

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ PHP NEWS
2020
- Hash:
2121
. Fixed GH-16711: Segfault in mhash(). (Girgias)
2222

23+
- Opcache:
24+
. Fixed GH-16839 (Error on building Opcache JIT for Windows ARM64). (cmb)
25+
2326
- PCNTL:
2427
. Fixed bug GH-16769: (pcntl_sigwaitinfo aborts on signal value
2528
as reference). (David Carlier)

ext/opcache/config.w32

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ARG_ENABLE("opcache", "whether to enable Zend OPcache support", "yes");
33

44
if (PHP_OPCACHE != "no") {
55

6-
ARG_ENABLE("opcache-jit", "whether to enable JIT", "yes");
6+
ARG_ENABLE("opcache-jit", "whether to enable JIT (not supported for ARM64)", "yes");
77

88
ZEND_EXTENSION('opcache', "\
99
ZendAccelerator.c \
@@ -23,7 +23,9 @@ if (PHP_OPCACHE != "no") {
2323
ADD_EXTENSION_DEP('opcache', 'pcre');
2424

2525
if (PHP_OPCACHE_JIT == "yes") {
26-
if (CHECK_HEADER_ADD_INCLUDE("ir/ir.h", "CFLAGS_OPCACHE", PHP_OPCACHE + ";ext\\opcache\\jit")) {
26+
if (TARGET_ARCH == 'arm64') {
27+
WARNING("JIT not enabled; not yet supported for ARM64");
28+
} else if (CHECK_HEADER_ADD_INCLUDE("ir/ir.h", "CFLAGS_OPCACHE", PHP_OPCACHE + ";ext\\opcache\\jit")) {
2729
var dasm_flags = (X64 ? "-D X64=1" : "") + (X64 ? " -D X64WIN=1" : "") + " -D WIN=1";
2830
var ir_target = (X64 ? "IR_TARGET_X64" : "IR_TARGET_X86");
2931
var ir_src = "ir_strtab.c ir_cfg.c ir_sccp.c ir_gcm.c ir_ra.c ir_save.c \

0 commit comments

Comments
 (0)