Skip to content

Commit 66efadd

Browse files
committed
Fix GH-16902: Set of opcache tests fail zts+aarch64 (8.2-8.3)
1 parent ff3b4ec commit 66efadd

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

ext/opcache/jit/zend_jit_arm64.dasc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2790,6 +2790,20 @@ static int zend_jit_setup(void)
27902790
/* Index is offset by 1 on FreeBSD (https://github.com/freebsd/freebsd-src/blob/22ca6db50f4e6bd75a141f57cf953d8de6531a06/lib/libc/gen/tls.c#L88) */
27912791
tsrm_tls_index = (tlsdesc->index + 1) * 8;
27922792
}
2793+
# elif defined(__MUSL__)
2794+
if (tsrm_ls_cache_tcb_offset == 0) {
2795+
size_t **where;
2796+
2797+
__asm__(
2798+
"adrp %0, :tlsdesc:_tsrm_ls_cache\n"
2799+
"add %0, %0, :tlsdesc_lo12:_tsrm_ls_cache\n"
2800+
: "=r" (where));
2801+
/* See https://github.com/ARM-software/abi-aa/blob/2a70c42d62e9c3eb5887fa50b71257f20daca6f9/aaelf64/aaelf64.rst */
2802+
size_t *tlsdesc = where[1];
2803+
2804+
tsrm_tls_offset = tlsdesc[1];
2805+
tsrm_tls_index = tlsdesc[0] * 8;
2806+
}
27932807
# else
27942808
ZEND_ASSERT(tsrm_ls_cache_tcb_offset != 0);
27952809
# endif

0 commit comments

Comments
 (0)