aboutsummaryrefslogtreecommitdiff
path: root/libphobos/m4
diff options
context:
space:
mode:
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2019-04-14 09:24:26 +0000
committerRainer Orth <ro@gcc.gnu.org>2019-04-14 09:24:26 +0000
commitba838aa6c360912bc203068ef2161fce137fb97d (patch)
tree8be2bdd527ac314700e88c5032ff77a139b23c3d /libphobos/m4
parent4d51312053fc8d12ddcdad6c2cf07d9437ac5e60 (diff)
downloadgcc-ba838aa6c360912bc203068ef2161fce137fb97d.zip
gcc-ba838aa6c360912bc203068ef2161fce137fb97d.tar.gz
gcc-ba838aa6c360912bc203068ef2161fce137fb97d.tar.bz2
Work around Solaris ld bug linking __tls_get_addr on 64-bit x86
* m4/druntime/os.m4 (DRUNTIME_OS_LINK_SPEC): New macro. * configure.ac: Call it. * configure: Regenerate. * Makefile.in, libdruntime/Makefile.in, src/Makefile.in, testsuite/Makefile.in: Regenerate. * src/libgphobos.spec.in (*link): Append OS_LINK_SPEC. From-SVN: r270346
Diffstat (limited to 'libphobos/m4')
-rw-r--r--libphobos/m4/druntime/os.m422
1 files changed, 22 insertions, 0 deletions
diff --git a/libphobos/m4/druntime/os.m4 b/libphobos/m4/druntime/os.m4
index 92a2ba5..295926c 100644
--- a/libphobos/m4/druntime/os.m4
+++ b/libphobos/m4/druntime/os.m4
@@ -183,3 +183,25 @@ AC_DEFUN([DRUNTIME_OS_MINFO_BRACKETING],
AM_CONDITIONAL([DRUNTIME_OS_MINFO_BRACKETING], [test "$DCFG_MINFO_BRACKETING" = "true"])
AC_LANG_POP([C])
])
+
+# DRUNTIME_OS_LINK_SPEC
+# ---------------------
+# Add target-specific link options to link_spec.
+AC_DEFUN([DRUNTIME_OS_LINK_SPEC],
+[
+ 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_SUBST(OS_LINK_SPEC)
+])