1
0
mirror of https://github.com/php/php-src.git synced 2026-03-28 10:12:18 +01:00
Files
archived-php-src/ext/opcache/config.w32
Christoph M. Becker e44b7625c5 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.
2024-11-18 23:27:54 +01:00

71 lines
2.4 KiB
Plaintext

ARG_ENABLE("opcache", "whether to enable Zend OPcache support", "yes");
if (PHP_OPCACHE != "no") {
ARG_ENABLE("opcache-jit", "whether to enable JIT (not supported for ARM64)", "yes");
ZEND_EXTENSION('opcache', "\
ZendAccelerator.c \
zend_accelerator_blacklist.c \
zend_accelerator_debug.c \
zend_accelerator_hash.c \
zend_accelerator_module.c \
zend_accelerator_util_funcs.c \
zend_persist.c \
zend_persist_calc.c \
zend_file_cache.c \
zend_shared_alloc.c \
shared_alloc_win32.c", true, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
ADD_EXTENSION_DEP('opcache', 'date');
ADD_EXTENSION_DEP('opcache', 'hash');
ADD_EXTENSION_DEP('opcache', 'pcre');
if (PHP_OPCACHE_JIT == "yes") {
if (TARGET_ARCH == 'arm64') {
WARNING("JIT not enabled; not yet supported for ARM64");
} else if (CHECK_HEADER_ADD_INCLUDE("ir/ir.h", "CFLAGS_OPCACHE", PHP_OPCACHE + ";ext\\opcache\\jit")) {
var dasm_flags = (X64 ? "-D X64=1" : "") + (X64 ? " -D X64WIN=1" : "") + " -D WIN=1";
var ir_target = (X64 ? "IR_TARGET_X64" : "IR_TARGET_X86");
var ir_src = "ir_strtab.c ir_cfg.c ir_sccp.c ir_gcm.c ir_ra.c ir_save.c \
ir_dump.c ir_check.c ir_patch.c";
DEFINE("IR_TARGET", ir_target);
DEFINE("DASM_FLAGS", dasm_flags);
DEFINE("DASM_ARCH", "x86");
AC_DEFINE('HAVE_JIT', 1, 'Define to 1 to enable JIT.');
ADD_FLAG("CFLAGS_OPCACHE", "/I \"ext\\opcache\\jit\\ir\" /D "+ir_target+" /D IR_PHP");
if (PHP_DEBUG == "yes") {
ADD_FLAG("CFLAGS_OPCACHE", "/D IR_DEBUG");
}
if (CHECK_HEADER_ADD_INCLUDE("capstone\\capstone.h", "CFLAGS_OPCACHE", PHP_OPCACHE+ ";" + PHP_PHP_BUILD + "\\include") &&
CHECK_LIB("capstone.lib", "opcache", PHP_OPCACHE)) {
AC_DEFINE('HAVE_CAPSTONE', 1, 'Define to 1 if Capstone is available.');
ir_src += " ir_disasm.c";
}
ADD_MAKEFILE_FRAGMENT(configure_module_dirname + "\\jit\\Makefile.frag.w32");
ADD_SOURCES(configure_module_dirname + "\\jit",
"zend_jit.c zend_jit_vm_helpers.c",
"opcache", "ext\\opcache\\jit");
ADD_SOURCES(configure_module_dirname + "\\jit\\ir",
"ir.c", "opcache", "ext\\opcache\\jit\\ir");
ADD_SOURCES(configure_module_dirname + "\\jit\\ir",
"ir_emit.c", "opcache", "ext\\opcache\\jit\\ir");
ADD_SOURCES(configure_module_dirname + "\\jit\\ir",
ir_src, "opcache", "ext\\opcache\\jit\\ir");
} else {
WARNING("JIT not enabled, headers not found");
}
}
ADD_FLAG('CFLAGS_OPCACHE', "/I " + configure_module_dirname);
}