summaryrefslogtreecommitdiff
path: root/libphobos/m4
diff options
context:
space:
mode:
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2019-05-07 10:38:45 +0000
committerRainer Orth <ro@gcc.gnu.org>2019-05-07 10:38:45 +0000
commitbca0a3216deff39ec9e4dcf979fff7f313ca6486 (patch)
treed79aa195465ae2ce02cb47114bdbe8ec96cd4401 /libphobos/m4
parent9edfa4c015a3ae0451a30259ef654c632f9f4ca5 (diff)
Check if Solaris ld supports -z relax=transtls
* m4/druntime/os.m4 (DRUNTIME_OS_LINK_SPEC): Only use -z relax=transtls if linker supports it. * configure.ac (enable_libphobos, LIBPHOBOS_SUPPORTED): Move down. (x86_64-*-solaris2.* | i?86-*-solaris2.*): Only mark supported with either gld or ld -z relax=transtls. * configure: Regenerate. From-SVN: r270939
Diffstat (limited to 'libphobos/m4')
-rw-r--r--libphobos/m4/druntime/os.m414
1 files changed, 13 insertions, 1 deletions
diff --git a/libphobos/m4/druntime/os.m4 b/libphobos/m4/druntime/os.m4
index b473ad5d88e..74167aa2cde 100644
--- a/libphobos/m4/druntime/os.m4
+++ b/libphobos/m4/druntime/os.m4
@@ -209,10 +209,22 @@ AC_DEFUN([DRUNTIME_OS_LINK_SPEC],
# 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`
+ druntime_ld_gld=no
+ druntime_ld_relax_transtls=no
if test -n "$druntime_ld_prog" \
&& $druntime_ld_prog -v 2>&1 | grep GNU > /dev/null 2>&1; then
- :
+ druntime_ld_gld=yes
else
+ echo 'int main (void) { return 0; }' > conftest.c
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -Wl,-z,relax=transtls"
+ if $CC $CFLAGS $LDFLAGS -o conftest conftest.c > /dev/null 2>&1; then
+ druntime_ld_relax_transtls=yes
+ fi
+ LDFLAGS="$save_LDFLAGS"
+ rm -f conftest.c conftest
+ fi
+ if test "$druntime_ld_relax_transtls" = "yes"; then
OS_LINK_SPEC='-z relax=transtls'
fi
;;