Skip to content

Commit cabe132

Browse files
committed
Disable IFUNC for dlopened SAPIs
Fixes #22269.
1 parent 3efb356 commit cabe132

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎Zend/zend_portability.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,8 +595,8 @@ extern "C++" {
595595

596596
/* Memory sanitizer is incompatible with ifunc resolvers. Even if the resolver
597597
* is marked as no_sanitize("memory") it will still be instrumented and crash. */
598-
#if __has_feature(memory_sanitizer) || __has_feature(thread_sanitizer) || \
599-
__has_feature(dataflow_sanitizer)
598+
#if defined(PHP_DISABLE_IFUNC) || __has_feature(memory_sanitizer) || \
599+
__has_feature(thread_sanitizer) || __has_feature(dataflow_sanitizer)
600600
# undef HAVE_FUNC_ATTRIBUTE_IFUNC
601601
#endif
602602

‎configure.ac‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,10 @@ AS_VAR_IF([PHP_BINARIES],,
296296
dnl Exit early.
297297
AS_VAR_IF([PHP_INSTALLED_SAPIS],, [AC_MSG_ERROR([Nothing to build.])])
298298

299+
AS_VAR_IF([php_tsrm_dlopened_sapi], [yes], [
300+
AC_DEFINE([PHP_DISABLE_IFUNC], [1], [Define to disable IFUNC resolvers.])
301+
])
302+
299303
dnl Add POSIX threads compilation and linker flags when thread safety is enabled
300304
dnl with either the '--enable-zts' configure option or automatically enabled by
301305
dnl PHP SAPIs. For example, Apache SAPI.

0 commit comments

Comments
 (0)