# The following variables are used in each case-construct to build up the
# outgoing variables:
#
-# gnu_ld Set to yes or no depending on whether the target
-# system normally uses GNU ld.
-#
# target_has_targetcm Set to yes or no depending on whether the target
# has its own definition of targetcm.
#
gdb_needs_out_file_path=
# Set this to control which thread package will be used.
thread_file=
-gnu_ld="$gnu_ld_flag"
default_use_cxa_atexit=no
default_gnu_indirect_function=no
target_gtfiles=
esac
;;
*-*-dragonfly*)
- gnu_ld=yes
tmake_file="t-slibgcc"
case ${enable_threads} in
"" | yes | posix)
# The machine-specific section should not tamper with this
# ordering but may order all other entries of tm_file as it
# pleases around the provided core setting.
- gnu_ld=yes
fbsd_major=`echo ${target} | sed -e 's/.*freebsd//g' | sed -e 's/\..*//g'`
if test "$fbsd_major" = ""; then
echo "Specify the major version number of the targeted FreeBSD release"
;;
*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu | *-*-uclinuxfdpiceabi)
extra_options="$extra_options gnu-user.opt"
- gnu_ld=yes
case ${enable_threads} in
"" | yes | posix) thread_file='posix' ;;
esac
tmake_file="t-netbsd t-slibgcc"
extra_objs="${extra_objs} netbsd.o"
d_target_objs="${d_target_objs} netbsd-d.o"
- gnu_ld=yes
use_gcc_stdint=wrap
case ${enable_threads} in
"" | yes | posix) thread_file='posix' ;;
target_has_targetrustm=yes
;;
*-*-phoenix*)
- gnu_ld=yes
default_use_cxa_atexit=yes
;;
*-*-rtems*)
fortran_target_objs="vms-f.o"
use_gcc_stdint=provide
tm_file="${tm_file} vms/vms-stdint.h"
- if test x$gnu_ld != xyes; then
+ if test x$ld_flavor != xgnu; then
# Build wrappers for native case.
extra_programs="ld\$(exeext) ar\$(exeext)"
tmake_file="$tmake_file vms/t-vmsnative"
tmake_file="${tmake_file} frv/t-frv frv/t-linux"
;;
ft32-*-elf)
- gnu_ld=yes
tm_file="elfos.h newlib-stdint.h ${tm_file}"
tmake_file="${tmake_file} ft32/t-ft32"
;;
thread_file=gcn
;;
moxie-*-elf)
- gnu_ld=yes
tm_file="elfos.h newlib-stdint.h ${tm_file}"
tmake_file="${tmake_file} moxie/t-moxie"
;;
moxie-*-uclinux*)
- gnu_ld=yes
tm_file="elfos.h ${tm_file} gnu-user.h linux.h glibc-stdint.h moxie/uclinux.h"
tmake_file="${tmake_file} moxie/t-moxie"
;;
tm_file="moxie/moxie.h elfos.h moxie/rtems.h rtems.h newlib-stdint.h"
;;
moxie-*-moxiebox*)
- gnu_ld=yes
tm_file="${tm_file} elfos.h moxie/moxiebox.h newlib-stdint.h"
tmake_file="${tmake_file} moxie/t-moxiebox"
;;
pa/pa64-linux.h"
tmake_file="${tmake_file} pa/t-pa pa/t-linux"
d_target_objs="${d_target_objs} pa-d.o"
- gnu_ld=yes
;;
hppa*-*-linux*)
target_cpu_default="MASK_PA_11|MASK_NO_SPACE_REGS|MASK_CALLER_COPIES"
extra_options="${extra_options} openbsd.opt"
tmake_file="pa/t-pa"
d_target_objs="${d_target_objs} pa-d.o"
- gnu_ld=yes
;;
hppa*-*-netbsd*)
target_cpu_default="MASK_PA_11|MASK_NO_SPACE_REGS"
;;
hppa*64*-*-hpux11*)
target_cpu_default="MASK_PA_11|MASK_PA_20"
- if test x$gnu_ld = xyes
- then
- target_cpu_default="${target_cpu_default}|MASK_GNU_LD"
- fi
tm_file="pa/pa64-start.h ${tm_file} elfos.h \
pa/pa64-regs.h pa/pa-hpux.h pa/pa-hpux1010.h \
pa/pa-hpux11.h"
tm_file="${tm_file} i386/unix.h i386/att.h elfos.h"
tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h i386/openbsdelf.h"
extra_options="${extra_options} openbsd.opt"
- gnu_ld=yes
;;
x86_64-*-openbsd*)
tm_file="${tm_file} i386/unix.h i386/att.h elfos.h"
tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h i386/x86-64.h i386/openbsdelf.h"
extra_options="${extra_options} openbsd.opt"
- gnu_ld=yes
;;
i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-gnu* | i[34567]86-*-kopensolaris*-gnu)
# Intel 80386's running GNU/*
tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/djgpp.h i386/djgpp-stdint.h"
native_system_header_dir=/dev/env/DJDIR/include
extra_options="${extra_options} i386/djgpp.opt"
- gnu_ld=yes
use_gcc_stdint=wrap
;;
i[34567]86-*-lynxos*)
tmake_file="${tmake_file} t-lynx"
extra_options="${extra_options} lynx.opt"
thread_file=lynx
- gnu_ld=yes
;;
i[34567]86-*-nto-qnx*)
tm_file="${tm_file} i386/att.h tm-dwarf2.h elfos.h i386/unix.h i386/nto.h"
extra_options="${extra_options} i386/nto.opt"
- gnu_ld=yes
;;
i[34567]86-*-rtems*)
tm_file="${tm_file} i386/unix.h i386/att.h elfos.h i386/i386elf.h i386/rtemself.h rtems.h newlib-stdint.h"
extra_objs="${extra_objs} winnt.o winnt-stubs.o winnt-dll.o"
c_target_objs="${c_target_objs} msformat-c.o"
cxx_target_objs="${cxx_target_objs} winnt-cxx.o msformat-c.o"
- gnu_ld=yes
default_use_cxa_atexit=yes
use_gcc_stdint=wrap
case ${enable_threads} in
tmake_file="ia64/t-ia64"
target_cpu_default="0"
target_cpu_default="${target_cpu_default}|MASK_GNU_AS"
- if test x$gnu_ld = xyes
- then
- target_cpu_default="${target_cpu_default}|MASK_GNU_LD"
- fi
+ target_cpu_default="${target_cpu_default}|MASK_GNU_LD"
;;
ia64*-*-freebsd*)
tm_file="${tm_file} elfos.h ${fbsd_tm_file} ia64/sysv4.h ia64/freebsd.h"
esac
tmake_file="${tmake_file} riscv/t-riscv riscv/t-linux"
tm_defines="${tm_defines} TARGET_DEFAULT_ASYNC_UNWIND_TABLES=1"
- gnu_ld=yes
case $target in
riscv32be-*|riscv64be-*)
tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
riscv*-*-gnu*)
tm_file="elfos.h gnu-user.h gnu.h glibc-stdint.h ${tm_file} riscv/gnu.h"
tmake_file="${tmake_file} riscv/t-riscv"
- gnu_ld=yes
case $target in
riscv32be-*|riscv64be-*)
tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
fi
esac
tmake_file="${tmake_file} riscv/t-riscv"
- gnu_ld=yes
case $target in
riscv32be-*|riscv64be-*)
tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
riscv*-*-freebsd*)
tm_file="${tm_file} elfos.h ${fbsd_tm_file} riscv/freebsd.h"
tmake_file="${tmake_file} riscv/t-riscv"
- gnu_ld=yes
case $target in
riscv32be-*|riscv64be-*)
tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
tm_file="${tm_file} loongarch/gnu-user.h loongarch/linux.h loongarch/loongarch-driver.h"
extra_options="${extra_options} linux-android.opt"
tmake_file="${tmake_file} loongarch/t-multilib loongarch/t-linux"
- gnu_ld=yes
# Force .init_array support. The configure script cannot always
# automatically detect that GAS supports it, yet we require it.
tm_file="elfos.h newlib-stdint.h ${tm_file}"
tm_file="${tm_file} loongarch/elf.h loongarch/loongarch-driver.h"
tmake_file="${tmake_file} loongarch/t-multilib"
- gnu_ld=yes
# For .init_array support. The configure script cannot always
# automatically detect that GAS supports it, yet we require it.
tm_defines="${tm_defines} MIPS_ISA_DEFAULT=MIPS_ISA_MIPS32R6 MIPS_ABI_DEFAULT=ABI_32"
with_arch_32="mips32r6"
with_arch_64="mips64r6"
- gnu_ld=yes
;;
mips*-mti-linux*)
tm_file="elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h mips/linux-common.h mips/mti-linux.h"
tm_defines="${tm_defines} MIPS_ISA_DEFAULT=MIPS_ISA_MIPS32R2 MIPS_ABI_DEFAULT=ABI_32"
with_arch_32="mips32r2"
with_arch_64="mips64r2"
- gnu_ld=yes
;;
mips*-*-linux*) # Linux MIPS, either endian.
tm_file="elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h mips/linux-common.h"
tmake_file="t-lynx rs6000/t-lynx"
extra_options="${extra_options} rs6000/sysv4.opt lynx.opt"
thread_file=lynx
- gnu_ld=yes
;;
powerpcle-*-elf*)
tm_file="${tm_file} elfos.h gnu-user.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/sysv4le.h"
tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h sparc/openbsd64.h"
extra_options="${extra_options} openbsd.opt"
extra_options="${extra_options}"
- gnu_ld=yes
with_cpu=ultrasparc
tmake_file="${tmake_file} sparc/t-sparc"
;;
;;
am33_2.0-*-linux*)
tm_file="mn10300/mn10300.h elfos.h gnu-user.h linux.h glibc-stdint.h mn10300/linux.h"
- gnu_ld=yes
use_collect2=no
;;
*)
;;
mips*-*-*)
- if test x$gnu_ld = xyes
- then
- target_cpu_default2="MASK_SPLIT_ADDRESSES"
- fi
+ target_cpu_default2="MASK_SPLIT_ADDRESSES"
case ${target} in
mips*el-*-*)
tm_defines="TARGET_ENDIAN_DEFAULT=0 $tm_defines"
*-*-aix*)
if $gcc_cv_ld -V 2>&1 | grep 'ld: LD ' > /dev/null; then
ld_flavor=aix
- gnu_ld=no
- else
- gnu_ld=yes
fi
;;
*-*-darwin*)
ld_flavor=darwin
- gnu_ld=no
;;
*-*-solaris2*)
if $gcc_cv_ld -V 2>&1 | grep 'Solaris Link Editors' > /dev/null; then
ld_flavor=solaris
- gnu_ld=no
- else
- gnu_ld=yes
fi
;;
hppa*64*-*-hpux11*)
if $gcc_cv_ld -V 2>&1 | grep 'linker command.*sgs.*ld PA64' > /dev/null; then
ld_flavor=hpux
- gnu_ld=no
- else
- gnu_ld=yes
fi
;;
nvptx-*-*)
ld_flavor=nvptx
- gnu_ld=no
;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_flavor" >&5
_ACEOF
-# Check if we are using GNU ld if not already set.
-if test -z "$gnu_ld"; then
- if $gcc_cv_ld --version 2>/dev/null | grep GNU > /dev/null; then
- gnu_ld=yes
- else
- gnu_ld=no
- fi
-fi
+# Settings that depend on ld_flavor must be done here instead of config.gcc.
case "$target:$ld_flavor" in
*-*-solaris2*:solaris)
;;
esac
+case "$target:$ld_flavor" in
+ hppa*64*-*-hpux11*:gnu)
+ target_cpu_default="${target_cpu_default}|MASK_GNU_LD"
+ ;;
+esac
+
# Check to see if we are using gold instead of ld
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using gold" >&5
$as_echo_n "checking whether we are using gold... " >&6; }
;;
# HP-UX ld uses -a flags to select between shared and archive.
*-*-hpux*)
- if test x"$gnu_ld" = xno; then
- gcc_cv_ld_static_dynamic=yes
- gcc_cv_ld_static_option="-aarchive_shared"
- gcc_cv_ld_dynamic_option="-adefault"
- fi
+ gcc_cv_ld_static_dynamic=yes
+ gcc_cv_ld_static_option="-aarchive_shared"
+ gcc_cv_ld_dynamic_option="-adefault"
;;
# Solaris 2 ld always supports -Bstatic/-Bdynamic.
*-*-solaris2*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_ld_static_dynamic" >&5
$as_echo "$gcc_cv_ld_static_dynamic" >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking linker --version-script option" >&5
-$as_echo_n "checking linker --version-script option... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking linker version script option" >&5
+$as_echo_n "checking linker version script option... " >&6; }
gcc_cv_ld_version_script=no
ld_version_script_option=''
-if test $in_tree_ld = yes || test x"$gnu_ld" = xyes; then
+if test $in_tree_ld = yes; then
gcc_cv_ld_version_script=yes
ld_version_script_option='--version-script'
-elif test x$ld_flavor = xsolaris; then
+elif test x$gcc_cv_ld != x; then
+ # Check if linker supports --version-script option
+ if $gcc_cv_ld --help 2>&1 | grep -- --version-script > /dev/null; then
+ gcc_cv_ld_version_script=yes
+ ld_version_script_option='--version-script'
+ fi
+fi
+if test x$ld_flavor = xsolaris; then
# Solaris 2 ld always supports -M. It also supports a subset of
# --version-script since Solaris 11.4, but requires
# -z gnu-version-script-compat to activate.
gcc_cv_ld_version_script=yes
ld_version_script_option='-M'
fi
-# Don't AC_DEFINE result, only used in jit/Make-lang.in so far.
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_ld_version_script" >&5
$as_echo "$gcc_cv_ld_version_script" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking linker soname option" >&5
$as_echo_n "checking linker soname option... " >&6; }
gcc_cv_ld_soname=no
-if test $in_tree_ld = yes || test x"$gnu_ld" = xyes; then
+if test $in_tree_ld = yes; then
gcc_cv_ld_soname=yes
ld_soname_option='-soname'
elif test x$gcc_cv_ld != x; then
- case "$target" in
- *-*-darwin*)
- gcc_cv_ld_soname=yes
- ld_soname_option='-install_name'
- ;;
- # Solaris 2 ld always supports -h. It also supports --soname for GNU
- # ld compatibility since some Solaris 10 update.
- *-*-solaris2*)
- gcc_cv_ld_soname=yes
- ld_soname_option='-h'
- ;;
- esac
+ # Check if linker supports -soname option
+ if $gcc_cv_ld --help 2>&1 | grep -- -soname > /dev/null; then
+ gcc_cv_ld_soname=yes
+ ld_soname_option='-soname'
+ fi
fi
-# Don't AC_DEFINE result, only used in jit/Make-lang.in so far.
+case "$target:$ld_flavor" in
+ *-*-darwin*:*)
+ gcc_cv_ld_soname=yes
+ ld_soname_option='-install_name'
+ ;;
+ # Solaris 2 ld always supports -h. It also supports --soname for GNU
+ # ld compatiblity since some Solaris 10 update.
+ *-*-solaris2*:solaris)
+ gcc_cv_ld_soname=yes
+ ld_soname_option='-h'
+ ;;
+esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_ld_soname" >&5
$as_echo "$gcc_cv_ld_soname" >&6; }
if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 14 -o "$gcc_cv_gld_major_version" -gt 2; then \
gcc_cv_ld_demangle=yes
fi
- elif test x$gcc_cv_ld != x -a x"$gnu_ld" = xyes; then
+ elif test x$gcc_cv_ld != x; then
# Check if the GNU linker supports --demangle option
if $gcc_cv_ld --help 2>&1 | grep no-demangle > /dev/null; then
gcc_cv_ld_demangle=yes
*-*-aix*)
if $gcc_cv_ld -V 2>&1 | grep 'ld: LD ' > /dev/null; then
ld_flavor=aix
- gnu_ld=no
- else
- gnu_ld=yes
fi
;;
*-*-darwin*)
ld_flavor=darwin
- gnu_ld=no
;;
*-*-solaris2*)
if $gcc_cv_ld -V 2>&1 | grep 'Solaris Link Editors' > /dev/null; then
ld_flavor=solaris
- gnu_ld=no
- else
- gnu_ld=yes
fi
;;
hppa*64*-*-hpux11*)
if $gcc_cv_ld -V 2>&1 | grep 'linker command.*sgs.*ld PA64' > /dev/null; then
ld_flavor=hpux
- gnu_ld=no
- else
- gnu_ld=yes
fi
;;
nvptx-*-*)
ld_flavor=nvptx
- gnu_ld=no
;;
esac
AC_MSG_RESULT($ld_flavor)
AC_SUBST(ORIGINAL_PLUGIN_LD_FOR_TARGET)
AC_DEFINE_UNQUOTED(PLUGIN_LD_SUFFIX, "$PLUGIN_LD_SUFFIX", [Specify plugin linker])
-# Check if we are using GNU ld if not already set.
-if test -z "$gnu_ld"; then
- if $gcc_cv_ld --version 2>/dev/null | grep GNU > /dev/null; then
- gnu_ld=yes
- else
- gnu_ld=no
- fi
-fi
+# Settings that depend on ld_flavor must be done here instead of config.gcc.
case "$target:$ld_flavor" in
*-*-solaris2*:solaris)
;;
esac
+case "$target:$ld_flavor" in
+ hppa*64*-*-hpux11*:gnu)
+ target_cpu_default="${target_cpu_default}|MASK_GNU_LD"
+ ;;
+esac
+
# Check to see if we are using gold instead of ld
AC_MSG_CHECKING(whether we are using gold)
ld_is_gold=no
;;
# HP-UX ld uses -a flags to select between shared and archive.
*-*-hpux*)
- if test x"$gnu_ld" = xno; then
- gcc_cv_ld_static_dynamic=yes
- gcc_cv_ld_static_option="-aarchive_shared"
- gcc_cv_ld_dynamic_option="-adefault"
- fi
+ gcc_cv_ld_static_dynamic=yes
+ gcc_cv_ld_static_option="-aarchive_shared"
+ gcc_cv_ld_dynamic_option="-adefault"
;;
# Solaris 2 ld always supports -Bstatic/-Bdynamic.
*-*-solaris2*)
fi
AC_MSG_RESULT($gcc_cv_ld_static_dynamic)
-AC_MSG_CHECKING(linker --version-script option)
+AC_MSG_CHECKING(linker version script option)
gcc_cv_ld_version_script=no
ld_version_script_option=''
-if test $in_tree_ld = yes || test x"$gnu_ld" = xyes; then
+if test $in_tree_ld = yes; then
gcc_cv_ld_version_script=yes
ld_version_script_option='--version-script'
-elif test x$ld_flavor = xsolaris; then
+elif test x$gcc_cv_ld != x; then
+ # Check if linker supports --version-script option
+ if $gcc_cv_ld --help 2>&1 | grep -- --version-script > /dev/null; then
+ gcc_cv_ld_version_script=yes
+ ld_version_script_option='--version-script'
+ fi
+fi
+if test x$ld_flavor = xsolaris; then
# Solaris 2 ld always supports -M. It also supports a subset of
# --version-script since Solaris 11.4, but requires
# -z gnu-version-script-compat to activate.
gcc_cv_ld_version_script=yes
ld_version_script_option='-M'
fi
-# Don't AC_DEFINE result, only used in jit/Make-lang.in so far.
AC_MSG_RESULT($gcc_cv_ld_version_script)
AC_SUBST(ld_version_script_option)
AC_MSG_CHECKING(linker soname option)
gcc_cv_ld_soname=no
-if test $in_tree_ld = yes || test x"$gnu_ld" = xyes; then
+if test $in_tree_ld = yes; then
gcc_cv_ld_soname=yes
ld_soname_option='-soname'
elif test x$gcc_cv_ld != x; then
- case "$target" in
- *-*-darwin*)
- gcc_cv_ld_soname=yes
- ld_soname_option='-install_name'
- ;;
- # Solaris 2 ld always supports -h. It also supports --soname for GNU
- # ld compatibility since some Solaris 10 update.
- *-*-solaris2*)
- gcc_cv_ld_soname=yes
- ld_soname_option='-h'
- ;;
- esac
+ # Check if linker supports -soname option
+ if $gcc_cv_ld --help 2>&1 | grep -- -soname > /dev/null; then
+ gcc_cv_ld_soname=yes
+ ld_soname_option='-soname'
+ fi
fi
-# Don't AC_DEFINE result, only used in jit/Make-lang.in so far.
+case "$target:$ld_flavor" in
+ *-*-darwin*:*)
+ gcc_cv_ld_soname=yes
+ ld_soname_option='-install_name'
+ ;;
+ # Solaris 2 ld always supports -h. It also supports --soname for GNU
+ # ld compatiblity since some Solaris 10 update.
+ *-*-solaris2*:solaris)
+ gcc_cv_ld_soname=yes
+ ld_soname_option='-h'
+ ;;
+esac
AC_MSG_RESULT($gcc_cv_ld_soname)
AC_SUBST(ld_soname_option)
if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 14 -o "$gcc_cv_gld_major_version" -gt 2; then \
gcc_cv_ld_demangle=yes
fi
- elif test x$gcc_cv_ld != x -a x"$gnu_ld" = xyes; then
+ elif test x$gcc_cv_ld != x; then
# Check if the GNU linker supports --demangle option
if $gcc_cv_ld --help 2>&1 | grep no-demangle > /dev/null; then
gcc_cv_ld_demangle=yes