|
86 | 86 | #ifndef __has_builtin |
87 | 87 | # define __has_builtin(x) 0 |
88 | 88 | #endif |
| 89 | +#ifndef __has_feature |
| 90 | +# define __has_feature(x) 0 |
| 91 | +#endif |
89 | 92 |
|
90 | 93 | #if defined(ZEND_WIN32) && !defined(__clang__) |
91 | 94 | # define ZEND_ASSUME(c) __assume(c) |
|
123 | 126 |
|
124 | 127 | #if defined(HAVE_LIBDL) && !defined(ZEND_WIN32) |
125 | 128 |
|
126 | | -# if defined(__has_feature) |
127 | | -# if __has_feature(address_sanitizer) |
128 | | -# define __SANITIZE_ADDRESS__ |
129 | | -# endif |
| 129 | +# if __has_feature(address_sanitizer) |
| 130 | +# define __SANITIZE_ADDRESS__ |
130 | 131 | # endif |
131 | 132 |
|
132 | 133 | # ifndef RTLD_LAZY |
|
145 | 146 |
|
146 | 147 | # if defined(RTLD_GROUP) && defined(RTLD_WORLD) && defined(RTLD_PARENT) |
147 | 148 | # define DL_LOAD(libname) dlopen(libname, PHP_RTLD_MODE | RTLD_GLOBAL | RTLD_GROUP | RTLD_WORLD | RTLD_PARENT) |
148 | | -# elif defined(RTLD_DEEPBIND) && !defined(__SANITIZE_ADDRESS__) |
| 149 | +# elif defined(RTLD_DEEPBIND) && !defined(__SANITIZE_ADDRESS__) && !__has_feature(memory_sanitizer) |
149 | 150 | # define DL_LOAD(libname) dlopen(libname, PHP_RTLD_MODE | RTLD_GLOBAL | RTLD_DEEPBIND) |
150 | 151 | # else |
151 | 152 | # define DL_LOAD(libname) dlopen(libname, PHP_RTLD_MODE | RTLD_GLOBAL) |
@@ -526,10 +527,8 @@ static zend_always_inline double _zend_get_nan(void) /* {{{ */ |
526 | 527 |
|
527 | 528 | /* Memory sanitizer is incompatible with ifunc resolvers. Even if the resolver |
528 | 529 | * is marked as no_sanitize("memory") it will still be instrumented and crash. */ |
529 | | -#if defined(__has_feature) |
530 | | -# if __has_feature(memory_sanitizer) |
531 | | -# undef HAVE_FUNC_ATTRIBUTE_IFUNC |
532 | | -# endif |
| 530 | +#if __has_feature(memory_sanitizer) |
| 531 | +# undef HAVE_FUNC_ATTRIBUTE_IFUNC |
533 | 532 | #endif |
534 | 533 |
|
535 | 534 | #if defined(HAVE_FUNC_ATTRIBUTE_IFUNC) && defined(HAVE_FUNC_ATTRIBUTE_TARGET) |
|
0 commit comments