1
1
diff --git a/build/order_by_dep.awk b/build/order_by_dep.awk
2
- index 1e71ea2069..3da32d8830 100644
2
+ index 1e71ea20..3da32d88 100644
3
3
--- a/build/order_by_dep.awk
4
4
+++ b/build/order_by_dep.awk
5
5
@@ -37,6 +37,11 @@ function get_module_index(name, i)
@@ -12,27 +12,27 @@ index 1e71ea2069..3da32d8830 100644
12
12
+ return;
13
13
+ }
14
14
mod_name_len = length(module_name);
15
-
15
+
16
16
for (ext in mod_deps) {
17
17
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
18
- index 8d45b2ae41..a7cc9abbb8 100644
18
+ index 3e8bdea9..4a784945 100644
19
19
--- a/ext/opcache/ZendAccelerator.c
20
20
+++ b/ext/opcache/ZendAccelerator.c
21
- @@ -93 ,7 +93 ,10 @@ typedef int gid_t;
21
+ @@ -97 ,7 +97 ,10 @@ typedef int gid_t;
22
22
#include <immintrin.h>
23
23
#endif
24
-
24
+
25
25
+ #ifdef COMPILE_DL_OPCACHE
26
- + // avoid symbol conflict
26
+ + // micro: avoid symbol conflict
27
27
ZEND_EXTENSION();
28
28
+ #endif
29
-
29
+
30
30
#ifndef ZTS
31
31
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)
33
33
#endif /* ZEND_WIN32 */
34
34
}
35
-
35
+
36
36
+ #ifdef COMPILE_DL_OPCACHE
37
37
ZEND_EXT_API zend_extension zend_extension_entry = {
38
38
+ #else
@@ -42,74 +42,69 @@ index 8d45b2ae41..a7cc9abbb8 100644
42
42
PHP_VERSION, /* version */
43
43
"Zend Technologies", /* author */
44
44
diff --git a/ext/opcache/config.m4 b/ext/opcache/config.m4
45
- index bef360e7c3..a96f80a82b 100644
45
+ index 8f6d5ab7..19530321 100644
46
46
--- a/ext/opcache/config.m4
47
47
+++ 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
+
49
51
if test "$PHP_OPCACHE" != "no"; then
50
-
51
- dnl Always build as shared extension
52
+ - dnl Always build as shared extension.
52
53
- ext_shared=yes
53
- + dnl why?
54
+ + dnl Always build as shared extension. (micro patches: no, we need static)
54
55
+ 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
+
65
63
+ AC_DEFINE(HAVE_OPCACHE, 1, [opcache enabled])
66
-
64
+ PHP_ADD_EXTENSION_DEP(opcache, date)
67
65
PHP_ADD_EXTENSION_DEP(opcache, pcre)
68
-
66
+
69
67
diff --git a/ext/opcache/config.w32 b/ext/opcache/config.w32
70
- index 24b4acaabc..452d57cc7d 100644
68
+ index d0af7258..a054e6c8 100644
71
69
--- a/ext/opcache/config.w32
72
70
+++ b/ext/opcache/config.w32
73
- @@ -16,7 +16,9 @@ if (PHP_OPCACHE != "no") {
71
+ @@ -16,8 +16,9 @@ if (PHP_OPCACHE != "no") {
74
72
zend_persist_calc.c \
75
73
zend_file_cache.c \
76
74
zend_shared_alloc.c \
77
75
- shared_alloc_win32.c", true, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
78
76
+ shared_alloc_win32.c", PHP_OPCACHE_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
79
- +
77
+
80
78
+ 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');
84
82
diff --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
86
84
--- a/ext/opcache/jit/ir/ir_gdb.c
87
85
+++ 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
92
90
- ir_gdbjit_descriptor __jit_debug_descriptor = {
93
91
+ static ir_gdbjit_descriptor __jit_debug_descriptor = {
94
92
1, IR_GDBJIT_NOACTION, NULL, NULL
95
93
};
96
-
97
- #ifdef IR_EXTERNAL_GDB_ENTRY
98
- void __jit_debug_register_code(void);
99
- #else
94
+
100
95
- IR_NEVER_INLINE void __jit_debug_register_code(void)
101
96
+ static IR_NEVER_INLINE void __jit_debug_register_code(void)
102
97
{
103
98
__asm__ __volatile__("");
104
99
}
105
100
diff --git a/main/main.c b/main/main.c
106
- index a3acaf94b7..a1324aab51 100644
101
+ index 0b38f303..b2cb9d4a 100644
107
102
--- a/main/main.c
108
103
+++ b/main/main.c
109
- @@ -2048 ,6 +2048 ,18 @@ void dummy_invalid_parameter_handler(
104
+ @@ -2099 ,6 +2099 ,18 @@ void dummy_invalid_parameter_handler(
110
105
}
111
106
#endif
112
-
107
+
113
108
+ // this can be moved to other place
114
109
+ #if defined(HAVE_OPCACHE) && !defined(COMPILE_DL_OPCACHE)
115
110
+ extern zend_extension opcache_zend_extension_entry;
@@ -125,26 +120,27 @@ index a3acaf94b7..a1324aab51 100644
125
120
/* {{{ php_module_startup */
126
121
zend_result php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_module)
127
122
{
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
129
124
ahead of all other internals
130
125
*/
131
126
php_ini_register_extensions();
132
127
+ #if defined(HAVE_OPCACHE) && !defined(COMPILE_DL_OPCACHE)
133
128
+ zend_load_static_extensions();
134
129
+ #endif
135
130
zend_startup_modules();
136
-
131
+
137
132
/* start Zend extensions */
138
133
diff --git a/win32/build/confutils.js b/win32/build/confutils.js
139
- index 1da17bddbd..8aa1e6557d 100644
134
+ index 1a4ddbff..f47090b7 100644
140
135
--- a/win32/build/confutils.js
141
136
+++ 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
+ }
143
139
}
144
140
}
145
-
146
- + // TODO: real skip zend extensions
147
- + if (extname != 'opcache')
141
+ -
142
+ + // micro: skip zend opcache
143
+ + if (extname != 'opcache')
148
144
extension_module_ptrs += '\tphpext_' + extname + '_ptr,\r\n';
149
-
145
+
150
146
DEFINE('CFLAGS_' + EXT + '_OBJ', '$(CFLAGS_PHP) $(CFLAGS_' + EXT + ')');
0 commit comments