Skip to content

Commit

Permalink
OpenBSD ZTS build fix
Browse files Browse the repository at this point in the history
Closes GH-7661.
  • Loading branch information
devnexen authored and nikic committed Nov 17, 2021
1 parent 8689248 commit fb3e646
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions TSRM/TSRM.c
Original file line number Diff line number Diff line change
Expand Up @@ -729,13 +729,13 @@ TSRM_API size_t tsrm_get_ls_cache_tcb_offset(void)
#if defined(__APPLE__) && defined(__x86_64__)
// TODO: Implement support for fast JIT ZTS code ???
return 0;
#elif defined(__x86_64__) && defined(__GNUC__) && !defined(__FreeBSD__)
#elif defined(__x86_64__) && defined(__GNUC__) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
size_t ret;

asm ("movq _tsrm_ls_cache@gottpoff(%%rip),%0"
: "=r" (ret));
return ret;
#elif defined(__i386__) && defined(__GNUC__) && !defined(__FreeBSD__)
#elif defined(__i386__) && defined(__GNUC__) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
size_t ret;

asm ("leal _tsrm_ls_cache@ntpoff,%0"
Expand Down
4 changes: 2 additions & 2 deletions ext/opcache/jit/zend_jit_x86.dasc
Original file line number Diff line number Diff line change
Expand Up @@ -2968,7 +2968,7 @@ 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) && !defined(__FreeBSD__)
#if defined(__has_attribute) && __has_attribute(tls_model) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
size_t ret;

asm ("movq _tsrm_ls_cache@gottpoff(%%rip),%0"
Expand All @@ -2987,7 +2987,7 @@ static int zend_jit_setup(void)
# elif defined(__GNUC__) && defined(__i386__)
tsrm_ls_cache_tcb_offset = tsrm_get_ls_cache_tcb_offset();
if (tsrm_ls_cache_tcb_offset == 0) {
#if !defined(__FreeBSD__)
#if !defined(__FreeBSD__) && !defined(__OpenBSD__)
size_t ret;

asm ("leal _tsrm_ls_cache@ntpoff,%0\n"
Expand Down

0 comments on commit fb3e646

Please sign in to comment.