diff --git a/Zend/Zend.m4 b/Zend/Zend.m4 index 33009e9909f5..1e91450fcb94 100644 --- a/Zend/Zend.m4 +++ b/Zend/Zend.m4 @@ -487,7 +487,7 @@ uint64_t key = UINT64_C(0x9d7f71d2bd296364); uintptr_t _a = 0; uintptr_t _b = 0; -uintptr_t __attribute__((preserve_none)) fun(uintptr_t a, uintptr_t b) { +uintptr_t __attribute__((preserve_none,noinline,used)) fun(uintptr_t a, uintptr_t b) { _a = a; _b = b; return (uintptr_t)const3; @@ -568,6 +568,7 @@ int main(void) { [php_cv_preserve_none=no], [php_cv_preserve_none=no]) ]) + AC_MSG_RESULT([$php_cv_preserve_none]) AS_VAR_IF([php_cv_preserve_none], [yes], [ AC_DEFINE([HAVE_PRESERVE_NONE], [1], [Define to 1 if you have preserve_none support.]) diff --git a/Zend/zend_portability.h b/Zend/zend_portability.h index c7e12d58c1f5..6546ebfb5b79 100644 --- a/Zend/zend_portability.h +++ b/Zend/zend_portability.h @@ -336,9 +336,12 @@ char *alloca(); # define ZEND_PRESERVE_NONE __attribute__((preserve_none)) #endif -#if __has_attribute(musttail) -# define HAVE_MUSTTAIL -# define ZEND_MUSTTAIL __attribute__((musttail)) + +#if !defined(__apple_build_version__) || (defined(__apple_build_version__) && __apple_build_version__ >= 17000404) +# if __has_attribute(musttail) +# define HAVE_MUSTTAIL +# define ZEND_MUSTTAIL __attribute__((musttail)) +# endif #endif #if (defined(__GNUC__) && __GNUC__ >= 3 && !defined(__INTEL_COMPILER) && !defined(__APPLE__) && !defined(__hpux) && !defined(_AIX) && !defined(__osf__)) || __has_attribute(noreturn)