Skip to content

Commit 4633e70

Browse files
committed
Fixed bug #80377
Make sure the $PHP_THREAD_SAFETY variable is always available when configuring extensions. It was previously available for phpized extensions, but for in-tree builds it was being set too late. Then, use $PHP_THREAD_SAFETY instead of $enable_zts to check for ZTS in bundled extensions, which makes sure these checks also work for phpize builds.
1 parent 37f96d9 commit 4633e70

File tree

5 files changed

+16
-15
lines changed

5 files changed

+16
-15
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ PHP NEWS
1616
- Opcache:
1717
. Fixed bug #80404 (Incorrect range inference result when division results
1818
in float). (Nikita)
19+
. Fixed bug #80377 (Opcache misses executor_globals). (Nikita)
1920

2021
- Standard:
2122
. Fixed bug #80366 (Return Value of zend_fstat() not Checked). (sagpant, cmb)

Zend/Zend.m4

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,6 @@ dnl LIBZEND_OTHER_CHECKS
190190
dnl
191191
AC_DEFUN([LIBZEND_OTHER_CHECKS],[
192192
193-
AC_ARG_ENABLE([zts],
194-
[AS_HELP_STRING([--enable-zts],
195-
[Enable thread safety])],
196-
[ZEND_ZTS=$enableval],
197-
[ZEND_ZTS=no])
198-
199193
AC_MSG_CHECKING(whether to enable thread-safety)
200194
AC_MSG_RESULT($ZEND_ZTS)
201195

configure.ac

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,19 @@ if test "$PHP_DEBUG_ASSERTIONS" = "yes"; then
797797
ZEND_DEBUG=yes
798798
fi
799799

800+
AC_ARG_ENABLE([zts],
801+
[AS_HELP_STRING([--enable-zts],
802+
[Enable thread safety])],
803+
[ZEND_ZTS=$enableval],
804+
[ZEND_ZTS=no])
805+
806+
if test "$ZEND_ZTS" = "yes"; then
807+
AC_DEFINE(ZTS, 1,[ ])
808+
PHP_THREAD_SAFETY=yes
809+
else
810+
PHP_THREAD_SAFETY=no
811+
fi
812+
800813
PHP_ARG_ENABLE([rtld-now],
801814
[whether to dlopen extensions with RTLD_NOW instead of RTLD_LAZY],
802815
[AS_HELP_STRING([--enable-rtld-now],
@@ -1136,13 +1149,6 @@ LIBZEND_BASIC_CHECKS
11361149
LIBZEND_DLSYM_CHECK
11371150
LIBZEND_OTHER_CHECKS
11381151

1139-
if test "$ZEND_ZTS" = "yes"; then
1140-
AC_DEFINE(ZTS,1,[ ])
1141-
PHP_THREAD_SAFETY=yes
1142-
else
1143-
PHP_THREAD_SAFETY=no
1144-
fi
1145-
11461152
INCLUDES="$INCLUDES -I\$(top_builddir)/TSRM"
11471153
INCLUDES="$INCLUDES -I\$(top_builddir)/Zend"
11481154

ext/opcache/config.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ if test "$PHP_OPCACHE" != "no"; then
6666
esac
6767
fi
6868

69-
if test "$enable_zts" = "yes"; then
69+
if test "$PHP_THREAD_SAFETY" = "yes"; then
7070
DASM_FLAGS="$DASM_FLAGS -D ZTS=1"
7171
fi
7272

ext/session/config.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ if test "$PHP_MM" != "no"; then
3131
AC_MSG_ERROR(cannot find mm library)
3232
fi
3333

34-
if test "$enable_zts" = "yes"; then
34+
if test "$PHP_THREAD_SAFETY" = "yes"; then
3535
dnl The mm library is not thread-safe, and mod_mm.c refuses to compile.
3636
AC_MSG_ERROR(--with-mm cannot be combined with --enable-zts)
3737
fi

0 commit comments

Comments
 (0)