* 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
2019-04-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+ * 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.
+
PR d/88150
* libdruntime/gcc/sections/elf_shared.d [Solaris] (SharedELF): Set
to true.
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OS_LINK_SPEC = @OS_LINK_SPEC@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
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
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
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
+ 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'
DRUNTIME_OS_THREAD_MODEL
DRUNTIME_OS_ARM_EABI_UNWINDER
DRUNTIME_OS_MINFO_BRACKETING
+DRUNTIME_OS_LINK_SPEC
DRUNTIME_LIBRARIES_CLIB
WITH_LOCAL_DRUNTIME([
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OS_LINK_SPEC = @OS_LINK_SPEC@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
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)
+])
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OS_LINK_SPEC = @OS_LINK_SPEC@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
@DRTSTUFF_SPEC@
+%rename link linkorig_gdc_renamed
+*link: %(linkorig_gdc_renamed) @OS_LINK_SPEC@
+
%rename lib liborig_gdc_renamed
*lib: %{debuglib|defaultlib|nophoboslib: ; :@SPEC_PHOBOS_DEPS@} %(liborig_gdc_renamed)
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OS_LINK_SPEC = @OS_LINK_SPEC@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@