diff options
Diffstat (limited to 'ext/opcache/jit/zend_jit_x86.dasc')
-rw-r--r-- | ext/opcache/jit/zend_jit_x86.dasc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/opcache/jit/zend_jit_x86.dasc b/ext/opcache/jit/zend_jit_x86.dasc index 388add37ea..7bb9c4e4b2 100644 --- a/ext/opcache/jit/zend_jit_x86.dasc +++ b/ext/opcache/jit/zend_jit_x86.dasc @@ -2366,6 +2366,13 @@ static int zend_jit_setup(void) # elif defined(__GNUC__) && defined(__x86_64__) tsrm_ls_cache_tcb_offset = tsrm_get_ls_cache_tcb_offset(); if (tsrm_ls_cache_tcb_offset == 0) { +#if defined(__has_attribute) && __has_attribute(tls_model) + size_t ret; + + asm ("movq _tsrm_ls_cache@gottpoff(%%rip),%0" + : "=r" (ret)); + tsrm_ls_cache_tcb_offset = ret; +#else size_t *ti; __asm__( @@ -2373,6 +2380,7 @@ static int zend_jit_setup(void) : "=a" (ti)); tsrm_tls_offset = ti[1]; tsrm_tls_index = ti[0] * 16; +#endif } # elif defined(__GNUC__) && defined(__i386__) tsrm_ls_cache_tcb_offset = tsrm_get_ls_cache_tcb_offset(); |