On Mon, Nov 2, 2009 at 3:06 PM, H.J. Lu <hongjiu...@intel.com> wrote: > Hi, > > This patch adds --enable-gold=both --with-linker=[bfd|gold] so that we > can build both ld and gold. This patch will > > 1. Install ld as ld.bfd > 2. Install gold as ld.gold > 3. Install one of them as ld, selected by --with-linker. > > If needed, gcc install invoke gold as ld.gold and ld as ld.bfd. Any > comments? >
Here is the updated patch. It installs ld.bfd/ld.gold only if both linkers are enabled. H.J. --- 2009-11-03 Roland McGrath <rol...@redhat.com> H.J. Lu <hongjiu...@intel.com> * configure.ac (--enable-gold): Accept --enable-gold=both to add gold to configdirs without removing ld. * configure: Regenerated. gold/ 2009-11-03 H.J. Lu <hongjiu...@intel.com> * Makefile.am (install-exec-local): Install as @installed_lin...@. Install as ld if "@linker@" == "ld.gold" and @installed_linker@ != "ld". * Makefile.in: Regenerated. * configure.ac (installed_linker): New substituted variable. Set by --enable-gold. (linker): New substituted variable. Set by --enable-gold and --with-linker. * configure: Regenerated. ld/ 2009-11-03 H.J. Lu <hongjiu...@intel.com> * Makefile.am (transform): Install as @installed_lin...@. (install-exec-local): Depend on install-binPROGRAMS. Install as @installed_lin...@. Install as ld if "@linker@" == "ld.bfd" and @installed_linker@ != "ld". * Makefile.in: Regenerated. * configure.ac (installed_linker): New substituted variable. Set by --enable-gold. (linker): New substituted variable. Set by --enable-gold and --with-linker. * configure: Regenerated.
2009-11-03 Roland McGrath <rol...@redhat.com> H.J. Lu <hongjiu...@intel.com> * configure.ac (--enable-gold): Accept --enable-gold=both to add gold to configdirs without removing ld. * configure: Regenerated. gold/ 2009-11-03 H.J. Lu <hongjiu...@intel.com> * Makefile.am (install-exec-local): Install as @installed_lin...@. Install as ld if "@linker@" == "ld.gold" and @installed_linker@ != "ld". * Makefile.in: Regenerated. * configure.ac (installed_linker): New substituted variable. Set by --enable-gold. (linker): New substituted variable. Set by --enable-gold and --with-linker. * configure: Regenerated. ld/ 2009-11-03 H.J. Lu <hongjiu...@intel.com> * Makefile.am (transform): Install as @installed_lin...@. (install-exec-local): Depend on install-binPROGRAMS. Install as @installed_lin...@. Install as ld if "@linker@" == "ld.bfd" and @installed_linker@ != "ld". * Makefile.in: Regenerated. * configure.ac (installed_linker): New substituted variable. Set by --enable-gold. (linker): New substituted variable. Set by --enable-gold and --with-linker. * configure: Regenerated. diff --git a/configure b/configure index 1ece75c..e353f63 100755 --- a/configure +++ b/configure @@ -1482,7 +1482,7 @@ Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-gold use gold instead of ld + --enable-gold[=ARG] build gold [ARG={yes,both}] --enable-libada build libada directory --enable-libssp build libssp directory --enable-build-with-cxx build with C++ compiler instead of C compiler @@ -3076,7 +3076,8 @@ else ENABLE_GOLD=no fi -if test "${ENABLE_GOLD}" = "yes"; then +case "${ENABLE_GOLD}" in +yes|both) # Check for ELF target. is_elf=no case "${target}" in @@ -3096,11 +3097,17 @@ if test "${ENABLE_GOLD}" = "yes"; then # Check for target supported by gold. case "${target}" in i?86-*-* | x86_64-*-* | sparc*-*-* | powerpc*-*-* | arm*-*-*) - configdirs="`echo " ${configdirs} " | sed -e 's/ ld / gold /'`" + if test "${ENABLE_GOLD}" = both; then + configdirs="$configdirs gold" + else + configdirs="`echo " ${configdirs} " | sed -e 's/ ld / gold /'`" + fi ;; esac fi -fi + ENABLE_GOLD=yes + ;; +esac # Configure extra directories which are host specific diff --git a/configure.ac b/configure.ac index 407ab59..b349633 100644 --- a/configure.ac +++ b/configure.ac @@ -311,10 +311,11 @@ esac # Handle --enable-gold. AC_ARG_ENABLE(gold, -[ --enable-gold use gold instead of ld], +[ --enable-gold[[=ARG]] build gold [[ARG={yes,both}]]], ENABLE_GOLD=$enableval, ENABLE_GOLD=no) -if test "${ENABLE_GOLD}" = "yes"; then +case "${ENABLE_GOLD}" in +yes|both) # Check for ELF target. is_elf=no case "${target}" in @@ -334,11 +335,17 @@ if test "${ENABLE_GOLD}" = "yes"; then # Check for target supported by gold. case "${target}" in i?86-*-* | x86_64-*-* | sparc*-*-* | powerpc*-*-* | arm*-*-*) - configdirs="`echo " ${configdirs} " | sed -e 's/ ld / gold /'`" + if test "${ENABLE_GOLD}" = both; then + configdirs="$configdirs gold" + else + configdirs="`echo " ${configdirs} " | sed -e 's/ ld / gold /'`" + fi ;; esac fi -fi + ENABLE_GOLD=yes + ;; +esac # Configure extra directories which are host specific diff --git a/gold/Makefile.am b/gold/Makefile.am index 8d8b617..85b103b 100644 --- a/gold/Makefile.am +++ b/gold/Makefile.am @@ -163,12 +163,20 @@ check: libgold.a install-exec-local: ld-new$(EXEEXT) $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(tooldir)/bin - n=`echo ld | sed '$(transform)'`; \ + n=`echo @installed_linker@ | sed '$(transform)'`; \ $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(bindir)/$${n}$(EXEEXT); \ - if test "$(bindir)" != "$(tooldir)/bin"; then \ - rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \ - ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \ + if test "@linker@" = "ld.gold"; then \ + if test "@installed_linker@" != "ld"; then \ + ld=`echo ld | sed '$(transform)'`; \ + rm -f $(DESTDIR)$(bindir)/$${ld}$(EXEEXT); \ + ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(bindir)/$${ld}$(EXEEXT) >/dev/null 2>/dev/null \ + || $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(bindir)/$${ld}$(EXEEXT); \ + fi; \ + if test "$(bindir)" != "$(tooldir)/bin"; then \ + rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \ + ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \ || $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \ + fi; \ fi # We want install to imply install-info as per GNU standards, despite diff --git a/gold/Makefile.in b/gold/Makefile.in index d4c689b..9b5c860 100644 --- a/gold/Makefile.in +++ b/gold/Makefile.in @@ -303,8 +303,10 @@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ +installed_linker = @installed_linker@ libdir = @libdir@ libexecdir = @libexecdir@ +linker = @linker@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ @@ -1200,12 +1202,20 @@ check: libgold.a install-exec-local: ld-new$(EXEEXT) $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(tooldir)/bin - n=`echo ld | sed '$(transform)'`; \ + n=`echo @installed_linker@ | sed '$(transform)'`; \ $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(bindir)/$${n}$(EXEEXT); \ - if test "$(bindir)" != "$(tooldir)/bin"; then \ - rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \ - ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \ + if test "@linker@" = "ld.gold"; then \ + if test "@installed_linke@" != "ld"; then \ + ld=`echo ld | sed '$(transform)'`; \ + rm -f $(DESTDIR)$(bindir)/$${ld}$(EXEEXT); \ + ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(bindir)/$${ld}$(EXEEXT) >/dev/null 2>/dev/null \ + || $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(bindir)/$${ld}$(EXEEXT); \ + fi; \ + if test "$(bindir)" != "$(tooldir)/bin"; then \ + rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \ + ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \ || $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \ + fi; \ fi # We want install to imply install-info as per GNU standards, despite diff --git a/gold/configure b/gold/configure index e4eb9fb..11cd48b 100755 --- a/gold/configure +++ b/gold/configure @@ -682,6 +682,8 @@ PLUGINS_FALSE PLUGINS_TRUE THREADS_FALSE THREADS_TRUE +linker +installed_linker am__untar am__tar AMTAR @@ -759,6 +761,8 @@ ac_subst_files='' ac_user_opts=' enable_option_checking with_sysroot +enable_gold +with_linker enable_threads enable_plugins enable_targets @@ -1403,6 +1407,7 @@ Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-gold[=ARG] build gold [ARG={yes,both}] --enable-threads multi-threaded linking --enable-plugins linker plugins --enable-targets alternative target configurations @@ -1418,6 +1423,7 @@ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-sysroot=DIR search for usr/lib et al within DIR + --with-linker=[ARG] specify the default linker [ARG={bfd,gold}] Some influential environment variables: CC C compiler command @@ -3227,6 +3233,36 @@ cat >>confdefs.h <<_ACEOF _ACEOF +# Check whether --enable-gold was given. +if test "${enable_gold+set}" = set; then : + enableval=$enable_gold; if test "${enableval}" = "both"; then + bfd_linker=ld.bfd + installed_linker=ld.gold + else + bfd_linker=ld.gold + installed_linker=ld + fi +else + bfd_linker=ld.bfd + installed_linker=ld +fi + + + + +# Check whether --with-linker was given. +if test "${with_linker+set}" = set; then : + withval=$with_linker; if test "$withval" = "gold"; then + linker=ld.gold + else + linker=$bfd_linker + fi +else + linker=$bfd_linker +fi + + + # Check whether --enable-threads was given. if test "${enable_threads+set}" = set; then : enableval=$enable_threads; case "${enableval}" in diff --git a/gold/configure.ac b/gold/configure.ac index 85e23f9..8a74b38 100644 --- a/gold/configure.ac +++ b/gold/configure.ac @@ -38,6 +38,29 @@ AC_DEFINE_UNQUOTED(TARGET_SYSTEM_ROOT, "$sysroot", AC_DEFINE_UNQUOTED(TARGET_SYSTEM_ROOT_RELOCATABLE, $sysroot_relocatable, [Whether the system root can be relocated]) +AC_ARG_ENABLE(gold, +[ --enable-gold[[=ARG]] build gold [[ARG={yes,both}]]], +[if test "${enableval}" = "both"; then + bfd_linker=ld.bfd + installed_linker=ld.gold + else + bfd_linker=ld.gold + installed_linker=ld + fi], +[bfd_linker=ld.bfd + installed_linker=ld]) +AC_SUBST(installed_linker) + +AC_ARG_WITH(linker, +[ --with-linker=[[ARG]] specify the default linker [[ARG={bfd,gold}]]], +[if test "$withval" = "gold"; then + linker=ld.gold + else + linker=$bfd_linker + fi], +[linker=$bfd_linker]) +AC_SUBST(linker) + dnl For now threads are a configure time option. AC_ARG_ENABLE([threads], [ --enable-threads multi-threaded linking], diff --git a/ld/Makefile.am b/ld/Makefile.am index c1d3dbf..1930a8b 100644 --- a/ld/Makefile.am +++ b/ld/Makefile.am @@ -95,7 +95,7 @@ CXX_FOR_TARGET = ` \ fi; \ fi` -transform = s/^ld-new$$/ld/;@program_transform_name@ +transform = s/^ld-new$$/@installed_linker@/;$(program_transform_name) bin_PROGRAMS = ld-new info_TEXINFOS = ld.texinfo ld_TEXINFOS = configdoc.texi @@ -1959,13 +1959,21 @@ CLEANFILES = dep.sed DEP DEPA DEP1 DEP2 spu_ovl.s spu_ovl.o spu_icache.s spu_ica .PHONY: install-exec-local install-data-local -install-exec-local: ld-new$(EXEEXT) +install-exec-local: ld-new$(EXEEXT) install-binPROGRAMS $(mkinstalldirs) $(DESTDIR)$(tooldir)/bin - n=`echo ld | sed '$(transform)'`; \ - if [ "$(bindir)/$$n$(EXEEXT)" != "$(tooldir)/bin/ld$(EXEEXT)" ]; then \ - rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \ - ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \ - || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \ + n=`echo @installed_linker@ | sed '$(transform)'`; \ + if test "@linker@" = "ld.bfd"; then \ + if test "@installed_linker@" != "ld"; then \ + ld=`echo ld | sed '$(transform)'`; \ + rm -f $(DESTDIR)$(bindir)/$$ld$(EXEEXT); \ + ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(bindir)/$$ld$(EXEEXT) >/dev/null 2>/dev/null \ + || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(bindir)/$$ld$(EXEEXT); \ + fi; \ + if test "$(bindir)/$$n$(EXEEXT)" != "$(tooldir)/bin/ld$(EXEEXT)"; then \ + rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \ + ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \ + || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \ + fi; \ fi install-data-local: diff --git a/ld/Makefile.in b/ld/Makefile.in index 0da0fff..2c5ab4a 100644 --- a/ld/Makefile.in +++ b/ld/Makefile.in @@ -152,7 +152,7 @@ CTAGS = ctags DEJATOOL = $(PACKAGE) RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir DIST_SUBDIRS = $(SUBDIRS) -transform = s/^ld-new$$/ld/;@program_transform_name@ +transform = s/^ld-new$$/@installed_linker@/;$(program_transform_name) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ @@ -293,8 +293,10 @@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ +installed_linker = @installed_linker@ libdir = @libdir@ libexecdir = @libexecdir@ +linker = @linker@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ @@ -3274,13 +3276,21 @@ mostlyclean-local: .PHONY: install-exec-local install-data-local -install-exec-local: ld-new$(EXEEXT) +install-exec-local: ld-new$(EXEEXT) install-binPROGRAMS $(mkinstalldirs) $(DESTDIR)$(tooldir)/bin - n=`echo ld | sed '$(transform)'`; \ - if [ "$(bindir)/$$n$(EXEEXT)" != "$(tooldir)/bin/ld$(EXEEXT)" ]; then \ - rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \ - ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \ - || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \ + n=`echo @installed_linker@ | sed '$(transform)'`; \ + if test "@linker@" = "ld.bfd"; then \ + if test "@installed_linker@" != "ld"; then \ + ld=`echo ld | sed '$(transform)'`; \ + rm -f $(DESTDIR)$(bindir)/$$ld$(EXEEXT); \ + ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(bindir)/$$ld$(EXEEXT) >/dev/null 2>/dev/null \ + || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(bindir)/$$ld$(EXEEXT); \ + fi; \ + if test "$(bindir)/$$n$(EXEEXT)" != "$(tooldir)/bin/ld$(EXEEXT)"; then \ + rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \ + ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \ + || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \ + fi; \ fi install-data-local: diff --git a/ld/configure b/ld/configure index 9eb6a17..4c091d5 100755 --- a/ld/configure +++ b/ld/configure @@ -797,6 +797,8 @@ GREP CPP NO_WERROR WARN_CFLAGS +linker +installed_linker TARGET_SYSTEM_ROOT_DEFINE TARGET_SYSTEM_ROOT use_sysroot @@ -901,6 +903,8 @@ with_lib_path enable_targets enable_64_bit_bfd with_sysroot +enable_gold +with_linker enable_got enable_werror enable_build_warnings @@ -1548,6 +1552,7 @@ Optional Features: (and sometimes confusing) to the casual installer --enable-targets alternative target configurations --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes) + --enable-gold[=ARG] build gold [ARG={yes,both}] --enable-got=<type> GOT handling scheme (target, single, negative, multigot) --enable-werror treat compile warnings as errors @@ -1565,6 +1570,7 @@ Optional Packages: --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-lib-path=dir1:dir2... set default LIB_PATH --with-sysroot=DIR Search for usr/lib et al within DIR. + --with-linker=[ARG] specify the default linker [ARG={bfd,gold}] --with-pic try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] @@ -4302,6 +4308,36 @@ fi +# Check whether --enable-gold was given. +if test "${enable_gold+set}" = set; then : + enableval=$enable_gold; if test "${enableval}" = "both"; then + gold_linker=ld.gold + installed_linker=ld.bfd +else + gold_linker=ld.bfd + installed_linker=ld +fi +else + gold_linker=ld.bfd + installed_linker=ld +fi + + + + +# Check whether --with-linker was given. +if test "${with_linker+set}" = set; then : + withval=$with_linker; if test "$withval" = "gold"; then + linker=$gold_linker + else + linker=ld.bfd + fi +else + linker=ld.bfd +fi + + + # Check whether --enable-got was given. if test "${enable_got+set}" = set; then : enableval=$enable_got; case "${enableval}" in @@ -6087,13 +6123,13 @@ if test "${lt_cv_nm_interface+set}" = set; then : else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:6090: $ac_compile\"" >&5) + (eval echo "\"\$as_me:6126: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:6093: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:6129: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:6096: output\"" >&5) + (eval echo "\"\$as_me:6132: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -7298,7 +7334,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 7301 "configure"' > conftest.$ac_ext + echo '#line 7337 "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -8560,11 +8596,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8563: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8599: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:8567: \$? = $ac_status" >&5 + echo "$as_me:8603: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -8899,11 +8935,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8902: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8938: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:8906: \$? = $ac_status" >&5 + echo "$as_me:8942: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -9004,11 +9040,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9007: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9043: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:9011: \$? = $ac_status" >&5 + echo "$as_me:9047: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -9059,11 +9095,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9062: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9098: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:9066: \$? = $ac_status" >&5 + echo "$as_me:9102: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -11441,7 +11477,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11444 "configure" +#line 11480 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11537,7 +11573,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11540 "configure" +#line 11576 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/ld/configure.in b/ld/configure.in index c4655f5..bff1d5e 100644 --- a/ld/configure.in +++ b/ld/configure.in @@ -69,6 +69,29 @@ AC_SUBST(use_sysroot) AC_SUBST(TARGET_SYSTEM_ROOT) AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE) +AC_ARG_ENABLE(gold, +[ --enable-gold[[=ARG]] build gold [[ARG={yes,both}]]], +[if test "${enableval}" = "both"; then + gold_linker=ld.gold + installed_linker=ld.bfd +else + gold_linker=ld.bfd + installed_linker=ld +fi], +[gold_linker=ld.bfd + installed_linker=ld]) +AC_SUBST(installed_linker) + +AC_ARG_WITH(linker, +[ --with-linker=[[ARG]] specify the default linker [[ARG={bfd,gold}]]], +[if test "$withval" = "gold"; then + linker=$gold_linker + else + linker=ld.bfd + fi], +[linker=ld.bfd]) +AC_SUBST(linker) + AC_ARG_ENABLE([got], AS_HELP_STRING([--enable-got=<type>], [GOT handling scheme (target, single, negative, multigot)]),