Skip to content

Conversation

@devnexen
Copy link
Member

Established that build < 1700.4.4.1 tends to fail thus we disable the preserve_none attribute feature for these cases.

…n mac.

Established that build < 1700.4.4.1 tends to fail thus we disable the
preserve_none attribute feature for these cases.
@dktapps
Copy link
Contributor

dktapps commented Dec 25, 2025

This doesn't fix the issue for me. I also don't see any sign of the Apple clang build train message in my config.log.

Output of clang --version if it's helpful:

% clang --version
Apple clang version 17.0.0 (clang-1700.0.13.5)
Target: arm64-apple-darwin24.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

@devnexen devnexen marked this pull request as draft December 25, 2025 20:37
@dktapps
Copy link
Contributor

dktapps commented Dec 25, 2025

Removing the -n from the sed command allowed it to check the version, but the check still passes. Looks like AS_VERSION_COMPARE doesn't understand it.

It might be better to use this, which is defined by clang:

#define __apple_build_version__ 17000013

The working version should be 17000404 I believe.

@devnexen
Copy link
Member Author

let me know if this is working out for you this time. Cheers.

@dktapps
Copy link
Contributor

dktapps commented Dec 26, 2025

Yep, that did the trick

@devnexen devnexen marked this pull request as ready for review December 26, 2025 00:45
@arnaud-lb
Copy link
Member

@devnexen do you think it would work if we added the __apple_build_version__ check here instead of what I suggested earlier?

It would be simpler, and would more directly be related to musttail.

@petk
Copy link
Member

petk commented Dec 27, 2025

Would this work instead of parsing the build version from a command in shell?

diff --git a/Zend/Zend.m4 b/Zend/Zend.m4
index 33009e9909f..b89f1f26d74 100644
--- a/Zend/Zend.m4
+++ b/Zend/Zend.m4
@@ -476,6 +476,13 @@ AC_DEFUN([ZEND_CHECK_PRESERVE_NONE], [dnl
   AC_CACHE_CHECK([for preserve_none calling convention],
    [php_cv_preserve_none],
    [AC_RUN_IFELSE([AC_LANG_SOURCE([[
+
+#ifdef __apple_build_version__
+# if __apple_build_version__ < 17000404
+#  error This version of Apple Clang doesn't support preserve_none
+# endif
+#endif
+
 #include <stdio.h>
 #include <stdint.h>

@devnexen
Copy link
Member Author

nice suggestion, going to try it.

Copy link
Member

@arnaud-lb arnaud-lb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m not able to test right now, but the zend_portability.h change looks right to me, and is probably enough. It also makes sense that it’s disabling musttail rather than preserve_none, even if the end result is the same, as the build issue is related to musttail.

#endif


#if !defined(__apple_build_version__) || (defined(__apple_build_version__) && __apple_build_version__ >= 17000404)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: please indent the nested cpp directives (with a space after the #)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compile fail on macOS 15.5 fatal error: error in backend: failed to perform tail call elimination on a call site marked musttail

4 participants