Forcibly disable TLS on OS X.
Forcibly disable TLS on OS X. gcc and llvm-gcc on OS X do not support
TLS, but clang does. Unfortunately, the implementation calls malloc()
internally during TLS initialization, which causes an unresolvable
bootstrapping issue.
diff --git a/configure.ac b/configure.ac
index e1a399b..7e4f221 100644
--- a/configure.ac
+++ b/configure.ac
@@ -214,6 +214,7 @@
RPATH=""
LD_PRELOAD_VAR="DYLD_INSERT_LIBRARIES"
so="dylib"
+ force_tls="0"
;;
*-*-freebsd*)
CFLAGS="$CFLAGS"
@@ -767,7 +768,6 @@
dnl it rather than pthreads TSD cleanup functions to support cleanup during
dnl thread exit, in order to avoid pthreads library recursion during
dnl bootstrapping.
-force_tls="0"
AC_CHECK_FUNC([_malloc_thread_cleanup],
[have__malloc_thread_cleanup="1"],
[have__malloc_thread_cleanup="0"]
@@ -813,6 +813,10 @@
AC_MSG_RESULT([Forcing TLS to avoid allocator/threading bootstrap issues])
enable_tls="1"
fi
+if test "x${enable_tls}" = "x1" -a "x${force_tls}" = "x0" ; then
+ AC_MSG_RESULT([Forcing no TLS to avoid allocator/threading bootstrap issues])
+ enable_tls="0"
+fi
if test "x${enable_tls}" = "x1" ; then
AC_MSG_CHECKING([for TLS])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(