Skip to content

Commit aa05c82

Browse files
committed
Merge branch 'PHP-8.4'
* PHP-8.4: Fix phpGH-16902: Set of opcache tests fail zts+aarch64 (8.4+) Fix phpGH-16902: Set of opcache tests fail zts+aarch64 (8.2-8.3)
2 parents 5e9273a + f4ca6d2 commit aa05c82

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

ext/opcache/jit/zend_jit_ir.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3237,6 +3237,20 @@ static void zend_jit_setup(void)
32373237
/* Index is offset by 1 on FreeBSD (https://github.com/freebsd/freebsd-src/blob/22ca6db50f4e6bd75a141f57cf953d8de6531a06/lib/libc/gen/tls.c#L88) */
32383238
tsrm_tls_index = (tlsdesc->index + 1) * 8;
32393239
}
3240+
# elif defined(__MUSL__)
3241+
if (tsrm_ls_cache_tcb_offset == 0) {
3242+
size_t **where;
3243+
3244+
__asm__(
3245+
"adrp %0, :tlsdesc:_tsrm_ls_cache\n"
3246+
"add %0, %0, :tlsdesc_lo12:_tsrm_ls_cache\n"
3247+
: "=r" (where));
3248+
/* See https://github.com/ARM-software/abi-aa/blob/2a70c42d62e9c3eb5887fa50b71257f20daca6f9/aaelf64/aaelf64.rst */
3249+
size_t *tlsdesc = where[1];
3250+
3251+
tsrm_tls_offset = tlsdesc[1];
3252+
tsrm_tls_index = tlsdesc[0] * 8;
3253+
}
32403254
# else
32413255
ZEND_ASSERT(tsrm_ls_cache_tcb_offset != 0);
32423256
# endif

0 commit comments

Comments
 (0)