Skip to content

Commit 94ba883

Browse files
authored
Fix TLS access in JIT with MUSL (#13329)
1 parent 199e48b commit 94ba883

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2901,6 +2901,14 @@ static int zend_jit_setup(void)
29012901
asm ("movq _tsrm_ls_cache@gottpoff(%%rip),%0"
29022902
: "=r" (ret));
29032903
tsrm_ls_cache_tcb_offset = ret;
2904+
#elif defined(__MUSL__)
2905+
size_t *ti;
2906+
2907+
__asm__(
2908+
"leaq _tsrm_ls_cache@tlsgd(%%rip), %0\n"
2909+
: "=a" (ti));
2910+
tsrm_tls_offset = ti[1];
2911+
tsrm_tls_index = ti[0] * 8;
29042912
#else
29052913
size_t *ti;
29062914

0 commit comments

Comments
 (0)