Just marking them as no_sanitize("memory") is unforunately not
sufficient, as the function still gets instrumented -- the attribute
only disables reporting.
* CPU support helpers from asan.
* See also https://github.com/google/sanitizers/issues/342. */
#if __has_attribute(no_sanitize_address)
-# if __has_feature(memory_sanitizer)
-# define ZEND_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address)) __attribute__((no_sanitize("memory")))
-# else
-# define ZEND_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address))
-# endif
+# define ZEND_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address))
#else
# define ZEND_NO_SANITIZE_ADDRESS
#endif
/* Intrinsics macros start. */
+/* Memory sanitizer is incompatible with ifunc resolvers. Even if the resolver
+ * is marked as no_sanitize("memory") it will still be instrumented and crash. */
+#if defined(__has_feature)
+# if __has_feature(memory_sanitizer)
+# undef HAVE_FUNC_ATTRIBUTE_IFUNC
+# endif
+#endif
+
#if defined(HAVE_FUNC_ATTRIBUTE_IFUNC) && defined(HAVE_FUNC_ATTRIBUTE_TARGET)
# define ZEND_INTRIN_HAVE_IFUNC_TARGET 1
#endif