]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libphobos/configure
Work around Solaris ld bug linking __tls_get_addr on 64-bit x86
[thirdparty/gcc.git] / libphobos / configure
index 48b78eb56dd21816cd554f8af175c052afe4ea3c..4ebad782abf02a621f482463f1b16ce0da087327 100755 (executable)
@@ -650,6 +650,7 @@ DCFG_HAVE_LIBATOMIC
 DCFG_HAVE_64BIT_ATOMICS
 DCFG_HAVE_ATOMIC_BUILTINS
 DCFG_HAVE_QSORT_R
+OS_LINK_SPEC
 DRUNTIME_OS_MINFO_BRACKETING_FALSE
 DRUNTIME_OS_MINFO_BRACKETING_TRUE
 DCFG_MINFO_BRACKETING
@@ -11495,7 +11496,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11498 "configure"
+#line 11499 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11601,7 +11602,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11604 "configure"
+#line 11605 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -14118,6 +14119,23 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
+  case $target in
+    i?86-*-solaris2.* | x86_64-*-solaris2.*)
+      # 64-bit Solaris/x86 ld breaks calls to __tls_get_addr with non-TLS
+      # relocs.  Work around by disabling TLS transitions.  Not necessary
+      # on 32-bit x86, but cannot be distinguished reliably in specs.
+      druntime_ld_prog=`$CC -print-prog-name=ld`
+      if test -n "$druntime_ld_prog" \
+         && $druntime_ld_prog -v 2>&1 | grep GNU > /dev/null 2>&1; then
+        :
+      else
+        OS_LINK_SPEC='-z relax=transtls'
+      fi
+      ;;
+  esac
+
+
+
   ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'