Skip to content

Commit 1787765

Browse files
committed
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
1 parent 5562e55 commit 1787765

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ PHP NEWS
66
. Sync all boost.context files with release 1.86.0. (mvorisek)
77
. Fixed bug GH-20435 (SensitiveParameter doesn't work for named argument
88
passing to variadic parameter). (ndossche)
9+
. Fixed bug GH-20546 (preserve_none attribute configure check on macOs
10+
issue). (David Carlier/cho-m)
911

1012
- Bz2:
1113
. Fix assertion failures resulting in crashes with stream filter

Zend/Zend.m4

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ dnl expectations.
474474
dnl
475475
AC_DEFUN([ZEND_CHECK_PRESERVE_NONE], [dnl
476476
AC_CACHE_CHECK([for preserve_none calling convention],
477-
[php_cv_preverve_none],
477+
[php_cv_preserve_none],
478478
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
479479
#include <stdio.h>
480480
#include <stdint.h>
@@ -504,7 +504,11 @@ uintptr_t __attribute__((preserve_none)) test(void) {
504504
"movq %2, %%r13\n"
505505
"xorq %3, %%r13\n"
506506
"xorq %%rax, %%rax\n"
507+
#if defined(__APPLE__)
508+
"call _fun\n"
509+
#else
507510
"call fun\n"
511+
#endif
508512
: "=a" (ret)
509513
: "r" (const1), "r" (const2), "r" (key)
510514
: "r12", "r13"
@@ -515,7 +519,11 @@ uintptr_t __attribute__((preserve_none)) test(void) {
515519
"eor x20, %1, %3\n"
516520
"eor x21, %2, %3\n"
517521
"eor x0, x0, x0\n"
522+
#if defined(__APPLE__)
523+
"bl _fun\n"
524+
#else
518525
"bl fun\n"
526+
#endif
519527
"mov %0, x0\n"
520528
: "=r" (ret)
521529
: "r" (const1), "r" (const2), "r" (key)

0 commit comments

Comments
 (0)