From 2f2fb1fbf1117f642cd1efdf33e431d42ee910ee Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Mon, 13 Oct 2025 20:48:24 +0000 Subject: [PATCH 1/2] Skip lc_ctype_inheritance.phpt on macos 15+ --- Zend/tests/lc_ctype_inheritance.phpt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Zend/tests/lc_ctype_inheritance.phpt b/Zend/tests/lc_ctype_inheritance.phpt index 8c968f0615e6e..69de59f69ac87 100644 --- a/Zend/tests/lc_ctype_inheritance.phpt +++ b/Zend/tests/lc_ctype_inheritance.phpt @@ -2,6 +2,9 @@ Do not inherit LC_CTYPE from environment --SKIPIF-- =')) { + die('skip macOS 15 inherits LC_CTYPE into the thread locale'); +} if (!setlocale(LC_CTYPE, "de_DE", "de-DE")) die("skip requires de_DE locale"); ?> --ENV-- From 9a2113a10443c214ae714b94fdeaa2e5c26056aa Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Tue, 9 Jan 2024 20:05:51 +0300 Subject: [PATCH 2/2] Disable inlining and inter-procedure-analyses for zend_string_equal_val() function that may be overriden for valgrind (#13099) This is a more safely way to fix GH-9068 --- Zend/zend_string.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/Zend/zend_string.c b/Zend/zend_string.c index c21b4f5d4610d..afc7325713c94 100644 --- a/Zend/zend_string.c +++ b/Zend/zend_string.c @@ -366,6 +366,7 @@ ZEND_API void zend_interned_strings_switch_storage(bool request) } } +#if defined(__GNUC__) && (defined(__i386__) || (defined(__x86_64__) && !defined(__ILP32__))) /* Even if we don't build with valgrind support, include the symbol so that valgrind available * only at runtime will not result in false positives. */ #ifndef I_REPLACE_SONAME_FNNAME_ZU @@ -373,29 +374,20 @@ ZEND_API void zend_interned_strings_switch_storage(bool request) #endif /* See GH-9068 */ -#if defined(__GNUC__) && (__GNUC__ >= 11 || defined(__clang__)) && __has_attribute(no_caller_saved_registers) -# define NO_CALLER_SAVED_REGISTERS __attribute__((no_caller_saved_registers)) -# ifndef __clang__ -# pragma GCC push_options -# pragma GCC target ("general-regs-only") -# define POP_OPTIONS -# endif +#if __has_attribute(noipa) +# define NOIPA __attribute__((noipa)) #else -# define NO_CALLER_SAVED_REGISTERS +# define NOIPA #endif -ZEND_API bool ZEND_FASTCALL NO_CALLER_SAVED_REGISTERS I_REPLACE_SONAME_FNNAME_ZU(NONE,zend_string_equal_val)(zend_string *s1, zend_string *s2) +ZEND_API bool ZEND_FASTCALL I_REPLACE_SONAME_FNNAME_ZU(NONE,zend_string_equal_val)(zend_string *s1, zend_string *s2) { return !memcmp(ZSTR_VAL(s1), ZSTR_VAL(s2), ZSTR_LEN(s1)); } - -#ifdef POP_OPTIONS -# pragma GCC pop_options -# undef POP_OPTIONS #endif #if defined(__GNUC__) && defined(__i386__) -ZEND_API bool ZEND_FASTCALL zend_string_equal_val(zend_string *s1, zend_string *s2) +ZEND_API zend_never_inline NOIPA bool ZEND_FASTCALL zend_string_equal_val(zend_string *s1, zend_string *s2) { const char *ptr = ZSTR_VAL(s1); uintptr_t delta = (uintptr_t) s2 - (uintptr_t) s1; @@ -433,7 +425,7 @@ ZEND_API bool ZEND_FASTCALL zend_string_equal_val(zend_string *s1, zend_string * } #elif defined(__GNUC__) && defined(__x86_64__) && !defined(__ILP32__) -ZEND_API bool ZEND_FASTCALL zend_string_equal_val(zend_string *s1, zend_string *s2) +ZEND_API zend_never_inline NOIPA bool ZEND_FASTCALL zend_string_equal_val(zend_string *s1, zend_string *s2) { const char *ptr = ZSTR_VAL(s1); uintptr_t delta = (uintptr_t) s2 - (uintptr_t) s1;