1 diff -urN php-7.2.25.orig/ext/pcre/config0.m4 php-7.2.25/ext/pcre/config0.m4
2 --- php-7.2.25.orig/ext/pcre/config0.m4 2019-12-12 23:55:51.061000000 +0100
3 +++ php-7.2.25/ext/pcre/config0.m4 2019-12-12 23:56:02.320000000 +0100
6 if test "$PHP_PCRE_REGEX" != "yes" && test "$PHP_PCRE_REGEX" != "no"; then
7 AC_MSG_CHECKING([for PCRE headers location])
8 - for i in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/include $PHP_PCRE_REGEX/include/pcre $PHP_PCRE_REGEX/local/include; do
9 + for i in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/include $PHP_PCRE_REGEX/include/pcre $PHP_PCRE_REGEX/local/include /usr/include; do
10 test -f $i/pcre.h && PCRE_INCDIR=$i
14 AC_MSG_RESULT([$PCRE_INCDIR])
16 AC_MSG_CHECKING([for PCRE library location])
17 - for j in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/$PHP_LIBDIR; do
18 + for j in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/$PHP_LIBDIR /usr/$PHP_LIBDIR; do
19 test -f $j/libpcre.a || test -f $j/libpcre.$SHLIB_SUFFIX_NAME && PCRE_LIBDIR=$j
26 - PHP_ADD_LIBRARY_WITH_PATH(pcre, $PCRE_LIBDIR)
27 + PHP_ADD_LIBRARY_WITH_PATH(pcre, $PCRE_LIBDIR, PCRE_SHARED_LIBADD)
29 AC_DEFINE(HAVE_PCRE, 1, [ ])
30 PHP_ADD_INCLUDE($PCRE_INCDIR)
31 - PHP_NEW_EXTENSION(pcre, php_pcre.c, no,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
32 + PHP_NEW_EXTENSION(pcre, php_pcre.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
33 PHP_INSTALL_HEADERS([ext/pcre], [php_pcre.h])
34 + EXTRA_LIBS="$EXTRA_LIBS -lpcre"
36 AC_MSG_CHECKING([for PCRE library to use])
37 AC_MSG_RESULT([bundled])
39 pcrelib/pcre_version.c pcrelib/pcre_xclass.c \
40 pcrelib/pcre_jit_compile.c"
41 PHP_PCRE_CFLAGS="-DHAVE_CONFIG_H -I@ext_srcdir@/pcrelib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
42 - PHP_NEW_EXTENSION(pcre, $pcrelib_sources php_pcre.c, no,,$PHP_PCRE_CFLAGS)
43 + PHP_NEW_EXTENSION(pcre, $pcrelib_sources php_pcre.c, $ext_shared,,$PHP_PCRE_CFLAGS)
44 PHP_ADD_BUILD_DIR($ext_builddir/pcrelib)
45 PHP_INSTALL_HEADERS([ext/pcre], [php_pcre.h pcrelib/])
46 AC_DEFINE(HAVE_BUNDLED_PCRE, 1, [ ])
47 diff -urN php-7.2.25.orig/ext/pcre/php_pcre.c php-7.2.25/ext/pcre/php_pcre.c
48 --- php-7.2.25.orig/ext/pcre/php_pcre.c 2019-12-12 23:55:51.061000000 +0100
49 +++ php-7.2.25/ext/pcre/php_pcre.c 2019-12-12 23:56:02.320000000 +0100
53 #include "php_globals.h"
55 +#define COMPILE_DL_PCRE_NOREDIRECT
58 #include "ext/standard/info.h"
59 #include "ext/standard/basic_functions.h"
61 REGISTER_LONG_CONSTANT("PREG_JIT_STACKLIMIT_ERROR", PHP_PCRE_JIT_STACKLIMIT_ERROR, CONST_CS | CONST_PERSISTENT);
62 REGISTER_STRING_CONSTANT("PCRE_VERSION", (char *)pcre_version(), CONST_CS | CONST_PERSISTENT);
65 + pcre_get_compiled_regex_p = pcre_get_compiled_regex;
66 + pcre_get_compiled_regex_cache_p = pcre_get_compiled_regex_cache;
67 + php_pcre_replace_impl_p = php_pcre_replace_impl;
68 + php_pcre_match_impl_p = php_pcre_match_impl;
69 + php_pcre_split_impl_p = php_pcre_split_impl;
75 diff -urN php-7.2.25.orig/ext/pcre/php_pcre.h php-7.2.25/ext/pcre/php_pcre.h
76 --- php-7.2.25.orig/ext/pcre/php_pcre.h 2019-12-12 23:55:51.061000000 +0100
77 +++ php-7.2.25/ext/pcre/php_pcre.h 2019-12-12 23:56:56.743000000 +0100
82 +#if !defined(COMPILE_DL_PCRE_NOREDIRECT)
83 +#define pcre_get_compiled_regex (*pcre_get_compiled_regex_p)
84 +#define pcre_get_compiled_regex_cache (*pcre_get_compiled_regex_cache_p)
85 +#define php_pcre_replace_impl (*php_pcre_replace_impl_p)
86 +#define php_pcre_match_impl (*php_pcre_match_impl_p)
87 +#define php_pcre_split_impl (*php_pcre_split_impl_p)
88 +#if !defined(COMPILE_DL_PCRE_NOEXTERN)
89 +# define PCRE_EXTERN extern
96 +extern void *pcre_get_compiled_regex_p;
97 +extern void *pcre_get_compiled_regex_cache_p;
98 +extern void *php_pcre_replace_impl_p;
99 +extern void *php_pcre_match_impl_p;
100 +extern void *php_pcre_split_impl_p;
103 PHPAPI zend_string *php_pcre_replace(zend_string *regex, zend_string *subject_str, char *subject, int subject_len, zend_string *replace_str, int limit, int *replace_count);
105 PHPAPI pcre* pcre_get_compiled_regex(zend_string *regex, pcre_extra **extra, int *options);
106 PHPAPI pcre* pcre_get_compiled_regex_ex(zend_string *regex, pcre_extra **extra, int *preg_options, int *coptions);
113 PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex);
114 PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache_ex(zend_string *regex, int locale_aware);
117 PHPAPI void php_pcre_match_impl( pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value,
118 zval *subpats, int global, int use_flags, zend_long flags, zend_long start_offset);
121 PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, zend_string *subject_str, char *subject, int subject_len, zend_string *replace_str,
122 int limit, int *replace_count);
125 PHPAPI void php_pcre_split_impl( pcre_cache_entry *pce, zend_string *subject_str, zval *return_value,
126 zend_long limit_val, zend_long flags);
128 diff -urN php-7.2.25.orig/ext/phar/Makefile.frag php-7.2.25/ext/phar/Makefile.frag
129 --- php-7.2.25.orig/ext/phar/Makefile.frag 2019-12-12 23:55:51.636000000 +0100
130 +++ php-7.2.25/ext/phar/Makefile.frag 2019-12-12 23:56:02.320000000 +0100
132 $(top_srcdir)/build/shtool echo -n -- "$(top_builddir)/$(SAPI_CLI_PATH) -n"; \
133 if test "x$(PHP_MODULES)" != "x"; then \
134 $(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(top_builddir)/modules"; \
135 - for i in spl bz2 zlib phar; do \
136 + for i in pcre spl bz2 zlib phar; do \
137 if test -f "$(top_builddir)/modules/$$i.la"; then \
138 . $(top_builddir)/modules/$$i.la; $(top_srcdir)/build/shtool echo -n -- " -d extension=$$dlname"; \
140 diff -urN php-7.2.25.orig/ext/standard/basic_functions.c php-7.2.25/ext/standard/basic_functions.c
141 --- php-7.2.25.orig/ext/standard/basic_functions.c 2019-12-12 23:55:51.046000000 +0100
142 +++ php-7.2.25/ext/standard/basic_functions.c 2019-12-12 23:56:02.321000000 +0100
144 PHPAPI php_basic_globals basic_globals;
148 +// for pcre shared patch symbol
149 +void *pcre_get_compiled_regex_p;
150 +void *pcre_get_compiled_regex_cache_p;
151 +void *php_pcre_replace_impl_p;
152 +void *php_pcre_match_impl_p;
153 +void *php_pcre_split_impl_p;
156 #include "php_fopen_wrappers.h"
157 #include "streamsfuncs.h"
159 diff -urN php-7.2.25.orig/main/php_ini.c php-7.2.25/main/php_ini.c
160 --- php-7.2.25.orig/main/php_ini.c 2019-12-12 23:55:50.942000000 +0100
161 +++ php-7.2.25/main/php_ini.c 2019-12-12 23:56:02.322000000 +0100
164 void php_ini_register_extensions(void)
166 - zend_llist_apply(&extension_lists.engine, php_load_zend_extension_cb);
167 zend_llist_apply(&extension_lists.functions, php_load_php_extension_cb);
168 + zend_llist_apply(&extension_lists.engine, php_load_zend_extension_cb);
170 zend_llist_destroy(&extension_lists.engine);
171 zend_llist_destroy(&extension_lists.functions);
172 diff -urN php-7.2.25.orig/sapi/cli/tests/018.phpt php-7.2.25/sapi/cli/tests/018.phpt
173 --- php-7.2.25.orig/sapi/cli/tests/018.phpt 2019-12-12 23:55:50.890000000 +0100
174 +++ php-7.2.25/sapi/cli/tests/018.phpt 2019-12-12 23:56:02.405000000 +0100