Skip to content

Commit 60462ee

Browse files
committed
Disable IFUNC for dlopened SAPIs
1 parent e92d9c4 commit 60462ee

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
@@ -593,8 +593,8 @@ extern "C++" {
593593

594594
/* Memory sanitizer is incompatible with ifunc resolvers. Even if the resolver
595595
* is marked as no_sanitize("memory") it will still be instrumented and crash. */
596-
#if __has_feature(memory_sanitizer) || __has_feature(thread_sanitizer) || \
597-
__has_feature(dataflow_sanitizer)
596+
#if defined(PHP_DISABLE_IFUNC) || __has_feature(memory_sanitizer) || \
597+
__has_feature(thread_sanitizer) || __has_feature(dataflow_sanitizer)
598598
# undef HAVE_FUNC_ATTRIBUTE_IFUNC
599599
#endif
600600

‎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)