Browse Source
Make OPcache non-optional
Make OPcache non-optional
This removes the --enable-opcache/--disable-opcache configure switch. OPcache is now always builtin. The default value of opcache.enable and opcache.enable_cli is unchanged. RFC: https://wiki.php.net/rfc/make_opcache_required Closes GH-18961. Co-authored-by: Tim Düsterhus <tim@tideways-gmbh.com>pull/19264/head
Failed to extract signature
21 changed files with 239 additions and 264 deletions
-
2.circleci/config.yml
-
3.github/actions/freebsd/action.yml
-
1.github/scripts/windows/test_task.bat
-
18.github/workflows/nightly.yml
-
5.github/workflows/push.yml
-
2NEWS
-
19UPGRADING
-
8docs/release-process.md
-
22ext/opcache/ZendAccelerator.c
-
4ext/opcache/ZendAccelerator.h
-
265ext/opcache/config.m4
-
111ext/opcache/config.w32
-
2ext/opcache/jit/Dockerfile.arm64.example
-
2ext/opcache/jit/README.md
-
1ext/opcache/tests/gh18417.phpt
-
22ext/opcache/zend_accelerator_module.c
-
7ext/opcache/zend_accelerator_module.h
-
2php.ini-development
-
2php.ini-production
-
1sapi/cli/tests/bug80092.phpt
-
4sapi/fuzzer/README.md
@ -1,75 +1,70 @@ |
|||
ARG_ENABLE("opcache", "whether to enable Zend OPcache support", "yes"); |
|||
ARG_ENABLE("opcache-jit", "whether to enable JIT (not supported for ARM64)", "yes"); |
|||
|
|||
PHP_OPCACHE="yes"; |
|||
|
|||
if (PHP_OPCACHE != "no") { |
|||
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", false, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); |
|||
|
|||
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'); |
|||
|
|||
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"; |
|||
|
|||
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"); |
|||
DEFINE("TLS_TARGET", "win"); |
|||
|
|||
DEFINE("IR_TARGET", ir_target); |
|||
DEFINE("DASM_FLAGS", dasm_flags); |
|||
DEFINE("DASM_ARCH", "x86"); |
|||
DEFINE("TLS_TARGET", "win"); |
|||
AC_DEFINE('HAVE_JIT', 1, 'Define to 1 to enable JIT.'); |
|||
|
|||
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"); |
|||
} |
|||
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"; |
|||
} |
|||
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_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"); |
|||
if (PHP_ZTS == "yes") { |
|||
ADD_SOURCES(configure_module_dirname + "\\jit\\tls", |
|||
ADD_SOURCES(configure_module_dirname + "\\jit", |
|||
"zend_jit.c zend_jit_vm_helpers.c", |
|||
"opcache", "ext\\opcache\\jit"); |
|||
if (PHP_ZTS == "yes") { |
|||
ADD_SOURCES(configure_module_dirname + "\\jit\\tls", |
|||
"zend_jit_tls_win.c", |
|||
"opcache", "ext\\opcache\\jit\\tls"); |
|||
} |
|||
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_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); |
|||
|
|||
} |
|||
|
|||
ADD_FLAG('CFLAGS_OPCACHE', "/I " + configure_module_dirname); |
Write
Preview
Loading…
Cancel
Save
Reference in new issue