11diff --git a/build/order_by_dep.awk b/build/order_by_dep.awk
2- index 1e71ea2069..3da32d8830 100644
2+ index 1e71ea20..3da32d88 100644
33--- a/build/order_by_dep.awk
44+++ b/build/order_by_dep.awk
55@@ -37,6 +37,11 @@ function get_module_index(name, i)
@@ -12,27 +12,27 @@ index 1e71ea2069..3da32d8830 100644
1212+ return;
1313+ }
1414 mod_name_len = length(module_name);
15-
15+
1616 for (ext in mod_deps) {
1717diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
18- index 8d45b2ae41..a7cc9abbb8 100644
18+ index 3e8bdea9..4a784945 100644
1919--- a/ext/opcache/ZendAccelerator.c
2020+++ b/ext/opcache/ZendAccelerator.c
21- @@ -93 ,7 +93 ,10 @@ typedef int gid_t;
21+ @@ -97 ,7 +97 ,10 @@ typedef int gid_t;
2222 #include <immintrin.h>
2323 #endif
24-
24+
2525+ #ifdef COMPILE_DL_OPCACHE
26- + // avoid symbol conflict
26+ + // micro: avoid symbol conflict
2727 ZEND_EXTENSION();
2828+ #endif
29-
29+
3030 #ifndef ZTS
3131 zend_accel_globals accel_globals;
32- @@ -4803 ,7 +4806 ,11 @@ static zend_result accel_finish_startup(void)
32+ @@ -4828 ,7 +4831 ,11 @@ static zend_result accel_finish_startup(void)
3333 #endif /* ZEND_WIN32 */
3434 }
35-
35+
3636+ #ifdef COMPILE_DL_OPCACHE
3737 ZEND_EXT_API zend_extension zend_extension_entry = {
3838+ #else
@@ -42,74 +42,69 @@ index 8d45b2ae41..a7cc9abbb8 100644
4242 PHP_VERSION, /* version */
4343 "Zend Technologies", /* author */
4444diff --git a/ext/opcache/config.m4 b/ext/opcache/config.m4
45- index bef360e7c3..a96f80a82b 100644
45+ index 8f6d5ab7..19530321 100644
4646--- a/ext/opcache/config.m4
4747+++ b/ext/opcache/config.m4
48- @@ -27,7 +27,8 @@ PHP_ARG_WITH([capstone],,
48+ @@ -26,8 +26,8 @@ PHP_ARG_WITH([capstone],
49+ [no])
50+
4951 if test "$PHP_OPCACHE" != "no"; then
50-
51- dnl Always build as shared extension
52+ - dnl Always build as shared extension.
5253- ext_shared=yes
53- + dnl why?
54+ + dnl Always build as shared extension. (micro patches: no, we need static)
5455+ dnl ext_shared=yes
55-
56- if test "$PHP_HUGE_CODE_PAGES" = "yes"; then
57- AC_DEFINE(HAVE_HUGE_CODE_PAGES, 1, [Define to enable copying PHP CODE pages into HUGE PAGES (experimental)])
58- @@ -337,7 +338,9 @@ int main(void) {
59- shared_alloc_mmap.c \
60- shared_alloc_posix.c \
61- $ZEND_JIT_SRC,
62- - shared,,"-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 ${JIT_CFLAGS}",,yes)
63- + $ext_shared,,"-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 ${JIT_CFLAGS}",,yes)
64- +
56+
57+ AS_VAR_IF([PHP_HUGE_CODE_PAGES], [yes],
58+ [AC_DEFINE([HAVE_HUGE_CODE_PAGES], [1],
59+ @@ -343,6 +343,7 @@ int main(void) {
60+ [-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 $JIT_CFLAGS],,
61+ [yes])
62+
6563+ AC_DEFINE(HAVE_OPCACHE, 1, [opcache enabled])
66-
64+ PHP_ADD_EXTENSION_DEP(opcache, date)
6765 PHP_ADD_EXTENSION_DEP(opcache, pcre)
68-
66+
6967diff --git a/ext/opcache/config.w32 b/ext/opcache/config.w32
70- index 24b4acaabc..452d57cc7d 100644
68+ index d0af7258..a054e6c8 100644
7169--- a/ext/opcache/config.w32
7270+++ b/ext/opcache/config.w32
73- @@ -16,7 +16,9 @@ if (PHP_OPCACHE != "no") {
71+ @@ -16,8 +16,9 @@ if (PHP_OPCACHE != "no") {
7472 zend_persist_calc.c \
7573 zend_file_cache.c \
7674 zend_shared_alloc.c \
7775- shared_alloc_win32.c", true, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
7876+ shared_alloc_win32.c", PHP_OPCACHE_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
79- +
77+
8078+ AC_DEFINE('HAVE_OPCACHE', 1, 'opcache enabled');
81-
82- if (PHP_OPCACHE_JIT == "yes") {
83- if (CHECK_HEADER_ADD_INCLUDE("ir/ir.h", "CFLAGS_OPCACHE", PHP_OPCACHE + ";ext\\opcache\\jit")) {
79+ ADD_EXTENSION_DEP('opcache', 'date');
80+ ADD_EXTENSION_DEP('opcache', 'hash');
81+ ADD_EXTENSION_DEP('opcache', 'pcre');
8482diff --git a/ext/opcache/jit/ir/ir_gdb.c b/ext/opcache/jit/ir/ir_gdb.c
85- index cf3a507d25..e679a8a55d 100644
83+ index ecaf8803..a8275466 100644
8684--- a/ext/opcache/jit/ir/ir_gdb.c
8785+++ b/ext/opcache/jit/ir/ir_gdb.c
88- @@ -500,14 +500,14 @@ typedef struct _ir_gdbjit_descriptor {
89- struct _ir_gdbjit_code_entry *first_entry ;
90- } ir_gdbjit_descriptor ;
91-
86+ @@ -504,11 +504,11 @@ typedef struct _ir_gdbjit_descriptor {
87+ extern ir_gdbjit_descriptor __jit_debug_descriptor ;
88+ void __jit_debug_register_code(void) ;
89+ #else
9290- ir_gdbjit_descriptor __jit_debug_descriptor = {
9391+ static ir_gdbjit_descriptor __jit_debug_descriptor = {
9492 1, IR_GDBJIT_NOACTION, NULL, NULL
9593 };
96-
97- #ifdef IR_EXTERNAL_GDB_ENTRY
98- void __jit_debug_register_code(void);
99- #else
94+
10095- IR_NEVER_INLINE void __jit_debug_register_code(void)
10196+ static IR_NEVER_INLINE void __jit_debug_register_code(void)
10297 {
10398 __asm__ __volatile__("");
10499 }
105100diff --git a/main/main.c b/main/main.c
106- index a3acaf94b7..a1324aab51 100644
101+ index 0b38f303..b2cb9d4a 100644
107102--- a/main/main.c
108103+++ b/main/main.c
109- @@ -2048 ,6 +2048 ,18 @@ void dummy_invalid_parameter_handler(
104+ @@ -2099 ,6 +2099 ,18 @@ void dummy_invalid_parameter_handler(
110105 }
111106 #endif
112-
107+
113108+ // this can be moved to other place
114109+ #if defined(HAVE_OPCACHE) && !defined(COMPILE_DL_OPCACHE)
115110+ extern zend_extension opcache_zend_extension_entry;
@@ -125,26 +120,27 @@ index a3acaf94b7..a1324aab51 100644
125120 /* {{{ php_module_startup */
126121 zend_result php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_module)
127122 {
128- @@ -2224 ,6 +2236 ,9 @@ zend_result php_module_startup(sapi_module_struct *sf, zend_module_entry *additi
123+ @@ -2283 ,6 +2295 ,9 @@ zend_result php_module_startup(sapi_module_struct *sf, zend_module_entry *additi
129124 ahead of all other internals
130125 */
131126 php_ini_register_extensions();
132127+ #if defined(HAVE_OPCACHE) && !defined(COMPILE_DL_OPCACHE)
133128+ zend_load_static_extensions();
134129+ #endif
135130 zend_startup_modules();
136-
131+
137132 /* start Zend extensions */
138133diff --git a/win32/build/confutils.js b/win32/build/confutils.js
139- index 1da17bddbd..8aa1e6557d 100644
134+ index 1a4ddbff..f47090b7 100644
140135--- a/win32/build/confutils.js
141136+++ b/win32/build/confutils.js
142- @@ -1534,6 +1534,8 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
137+ @@ -1531,7 +1531,8 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
138+ }
143139 }
144140 }
145-
146- + // TODO: real skip zend extensions
147- + if (extname != 'opcache')
141+ -
142+ + // micro: skip zend opcache
143+ + if (extname != 'opcache')
148144 extension_module_ptrs += '\tphpext_' + extname + '_ptr,\r\n';
149-
145+
150146 DEFINE('CFLAGS_' + EXT + '_OBJ', '$(CFLAGS_PHP) $(CFLAGS_' + EXT + ')');
0 commit comments