summaryrefslogtreecommitdiff
path: root/TSRM
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2021-03-10 16:03:47 +0300
committerDmitry Stogov <dmitry@zend.com>2021-03-10 16:03:47 +0300
commit3b377b51a22681f4594f8eb55e6de25ea01204c1 (patch)
tree270f8e34f54da76bc3daa38f663acaa4d883e5b2 /TSRM
parent7931956805beba80188f3c0638c285f8fb75dfe1 (diff)
downloadphp-git-3b377b51a22681f4594f8eb55e6de25ea01204c1.tar.gz
Fixed bug #80814 (threaded mod_php won't load on FreeBSD: No space available for static Thread Local Storage)
Diffstat (limited to 'TSRM')
-rw-r--r--TSRM/TSRM.c4
-rw-r--r--TSRM/TSRM.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/TSRM/TSRM.c b/TSRM/TSRM.c
index cd340035a2..2d60b6a9d6 100644
--- a/TSRM/TSRM.c
+++ b/TSRM/TSRM.c
@@ -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__)
+#elif defined(__x86_64__) && defined(__GNUC__) && !defined(__FreeBSD__)
size_t ret;
asm ("movq _tsrm_ls_cache@gottpoff(%%rip),%0"
: "=r" (ret));
return ret;
-#elif defined(__i386__) && defined(__GNUC__)
+#elif defined(__i386__) && defined(__GNUC__) && !defined(__FreeBSD__)
size_t ret;
asm ("leal _tsrm_ls_cache@ntpoff,%0"
diff --git a/TSRM/TSRM.h b/TSRM/TSRM.h
index 6978b49732..eea158d015 100644
--- a/TSRM/TSRM.h
+++ b/TSRM/TSRM.h
@@ -147,7 +147,7 @@ TSRM_API const char *tsrm_api_name(void);
# define __has_attribute(x) 0
#endif
-#if !__has_attribute(tls_model)
+#if !__has_attribute(tls_model) || defined(__FreeBSD__)
# define TSRM_TLS_MODEL_ATTR
#elif __PIC__
# define TSRM_TLS_MODEL_ATTR __attribute__((tls_model("initial-exec")))