From 3625cbb344845628080658f4a200bd731200feee Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Tue, 2 Sep 2025 09:56:46 +0200 Subject: [PATCH] Fix ZTS+JIT build on non-glibc/musl/freebsd/macos/win platforms Fixes GH-19657 Closes GH-19667 --- NEWS | 2 ++ ext/opcache/jit/tls/zend_jit_tls_aarch64.c | 2 ++ ext/opcache/jit/tls/zend_jit_tls_x86.c | 2 ++ ext/opcache/jit/tls/zend_jit_tls_x86_64.c | 2 ++ 4 files changed, 8 insertions(+) diff --git a/NEWS b/NEWS index 8e1225b936e..19438cf69f1 100644 --- a/NEWS +++ b/NEWS @@ -19,6 +19,8 @@ PHP NEWS . Fixed bug GH-19486 (Incorrect opline after deoptimization). (Arnaud) . Fixed bug GH-19601 (Wrong JIT stack setup on aarch64/clang). (Arnaud) . Fixed bug GH-19388 (Broken opcache.huge_code_pages). (Arnaud) + . Fixed bug GH-19657 (Build fails on non-glibc/musl/freebsd/macos/win + platforms). (Arnaud) - PCRE: . Upgraded to pcre2lib from 10.45 to 10.46. (nielsdos) diff --git a/ext/opcache/jit/tls/zend_jit_tls_aarch64.c b/ext/opcache/jit/tls/zend_jit_tls_aarch64.c index 2dc82221e9c..24f0f88454b 100644 --- a/ext/opcache/jit/tls/zend_jit_tls_aarch64.c +++ b/ext/opcache/jit/tls/zend_jit_tls_aarch64.c @@ -238,6 +238,7 @@ void *zend_jit_tsrm_ls_cache_address( size_t module_index, size_t module_offset ) { +#ifndef USE_FALLBACK char *thread_pointer; __asm__ __volatile__( "mrs %0, tpidr_el0\n" @@ -251,5 +252,6 @@ void *zend_jit_tsrm_ls_cache_address( dtv_pointer_t *dtv = *(dtv_pointer_t**)((uintptr_t)thread_pointer + DTV_OFFSET); return (void*)(((dtv_pointer_t*)((char*)dtv + module_index))->val + module_offset); } +#endif return NULL; } diff --git a/ext/opcache/jit/tls/zend_jit_tls_x86.c b/ext/opcache/jit/tls/zend_jit_tls_x86.c index bca46c8f826..4e06bbd1eac 100644 --- a/ext/opcache/jit/tls/zend_jit_tls_x86.c +++ b/ext/opcache/jit/tls/zend_jit_tls_x86.c @@ -222,6 +222,7 @@ void *zend_jit_tsrm_ls_cache_address( size_t module_index, size_t module_offset ) { +#ifndef USE_FALLBACK char *thread_pointer; __asm__ __volatile__( "movl %%gs:0, %0\n" @@ -235,5 +236,6 @@ void *zend_jit_tsrm_ls_cache_address( dtv_pointer_t *dtv = *(dtv_pointer_t**)((uintptr_t)thread_pointer + DTV_OFFSET); return (void*)(((dtv_pointer_t*)((char*)dtv + module_index))->val + module_offset); } +#endif return NULL; } diff --git a/ext/opcache/jit/tls/zend_jit_tls_x86_64.c b/ext/opcache/jit/tls/zend_jit_tls_x86_64.c index 3adeb1ff806..11ffe495fcb 100644 --- a/ext/opcache/jit/tls/zend_jit_tls_x86_64.c +++ b/ext/opcache/jit/tls/zend_jit_tls_x86_64.c @@ -205,6 +205,7 @@ void *zend_jit_tsrm_ls_cache_address( size_t module_index, size_t module_offset ) { +#ifndef USE_FALLBACK char *thread_pointer; __asm__ __volatile__( "movq %%fs:0, %0\n" @@ -218,5 +219,6 @@ void *zend_jit_tsrm_ls_cache_address( dtv_pointer_t *dtv = *(dtv_pointer_t**)((uintptr_t)thread_pointer + DTV_OFFSET); return (void*)(((dtv_pointer_t*)((char*)dtv + module_index))->val + module_offset); } +#endif return NULL; }