1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Fix GH-20546: Zend preserve_none attribute config check on macOs issue.

This attribute fails on macOs due to the inline assembly test.
Due to an old Darwin C ABI convention, symbols are prefixed with an
underscore so we need to take in account also for x86_64.

close GH-20559
This commit is contained in:
David Carlier
2025-11-22 11:05:39 +00:00
parent 5562e5558a
commit 1787765696
2 changed files with 11 additions and 1 deletions

2
NEWS
View File

@@ -6,6 +6,8 @@ PHP NEWS
. Sync all boost.context files with release 1.86.0. (mvorisek)
. Fixed bug GH-20435 (SensitiveParameter doesn't work for named argument
passing to variadic parameter). (ndossche)
. Fixed bug GH-20546 (preserve_none attribute configure check on macOs
issue). (David Carlier/cho-m)
- Bz2:
. Fix assertion failures resulting in crashes with stream filter

View File

@@ -474,7 +474,7 @@ dnl expectations.
dnl
AC_DEFUN([ZEND_CHECK_PRESERVE_NONE], [dnl
AC_CACHE_CHECK([for preserve_none calling convention],
[php_cv_preverve_none],
[php_cv_preserve_none],
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdio.h>
#include <stdint.h>
@@ -504,7 +504,11 @@ uintptr_t __attribute__((preserve_none)) test(void) {
"movq %2, %%r13\n"
"xorq %3, %%r13\n"
"xorq %%rax, %%rax\n"
#if defined(__APPLE__)
"call _fun\n"
#else
"call fun\n"
#endif
: "=a" (ret)
: "r" (const1), "r" (const2), "r" (key)
: "r12", "r13"
@@ -515,7 +519,11 @@ uintptr_t __attribute__((preserve_none)) test(void) {
"eor x20, %1, %3\n"
"eor x21, %2, %3\n"
"eor x0, x0, x0\n"
#if defined(__APPLE__)
"bl _fun\n"
#else
"bl fun\n"
#endif
"mov %0, x0\n"
: "=r" (ret)
: "r" (const1), "r" (const2), "r" (key)