Commit 95a83956a4b for php.net
commit 95a83956a4b47a55baa8ef4638710511d30235fc
Author: David Carlier <devnexen@gmail.com>
Date: Thu Dec 25 08:23:39 2025 +0000
Fix GH-20767: build failure with preserve_none attribute enabled on mac.
Established that build < 1700.4.4.1 tends to fail thus we disable the
preserve_none attribute feature for these cases.
close GH-20777
diff --git a/NEWS b/NEWS
index c8ac6f1990c..ef10d7274a0 100644
--- a/NEWS
+++ b/NEWS
@@ -2,7 +2,11 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? ????, PHP 8.5.3
-
+- Core:
+ . Fixed bug GH-20806 (preserve_none feature compatiblity with LTO).
+ (henderkes)
+ . Fixed bug GH-20767 (build failure with musttail/preserve_none feature
+ on macOs). (David Carlier)
15 Jan 2026, PHP 8.5.2
diff --git a/Zend/zend_portability.h b/Zend/zend_portability.h
index c7e12d58c1f..6546ebfb5b7 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)