Skip to content

Commit

Permalink
Fix TLS access in JIT with MUSL (#13329)
Browse files Browse the repository at this point in the history
  • Loading branch information
dstogov authored Feb 12, 2024
1 parent 199e48b commit 94ba883
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ext/opcache/jit/zend_jit_x86.dasc
Original file line number Diff line number Diff line change
Expand Up @@ -2901,6 +2901,14 @@ static int zend_jit_setup(void)
asm ("movq _tsrm_ls_cache@gottpoff(%%rip),%0"
: "=r" (ret));
tsrm_ls_cache_tcb_offset = ret;
#elif defined(__MUSL__)
size_t *ti;

__asm__(
"leaq _tsrm_ls_cache@tlsgd(%%rip), %0\n"
: "=a" (ti));
tsrm_tls_offset = ti[1];
tsrm_tls_index = ti[0] * 8;
#else
size_t *ti;

Expand Down

0 comments on commit 94ba883

Please sign in to comment.