This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH RFC: Add --enable-gold
- From: Ian Lance Taylor <iant at google dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 20 Mar 2008 22:54:02 -0700
- Subject: PATCH RFC: Add --enable-gold
As a first step to releasing a new linker, called gold, I plan to
commit this patch to the top level configure script and Makefile.
This patch is only needed in the binutils repository, but the top
level files are shared between binutils and gcc.
I plan to commit unless I hear some comments. Thanks.
Tested with bootstrap on i686-pc-linux-gnu.
Ian
2008-03-20 Ian Lance Taylor <iant@google.com>
* configure.ac: Add support for --enable-gold.
* Makefile.def: Add gold as a directory like ld.
* configure, Makefile.in: Regenerate.
Index: configure.ac
===================================================================
--- configure.ac (revision 133415)
+++ configure.ac (working copy)
@@ -163,6 +163,7 @@ host_libs="intl mmalloc libiberty opcode
# know that we are building the simulator.
# binutils, gas and ld appear in that order because it makes sense to run
# "make check" in that particular order.
+# If --enable-gold is used, "gold" will replace "ld".
host_tools="texinfo byacc flex bison binutils gas ld fixincludes gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar gnattools"
# libgcj represents the runtime libraries only used by gcj.
@@ -239,7 +240,7 @@ use_gnu_ld=
# Make sure we don't let GNU ld be added if we didn't want it.
if test x$with_gnu_ld = xno ; then
use_gnu_ld=no
- noconfigdirs="$noconfigdirs ld"
+ noconfigdirs="$noconfigdirs ld gold"
fi
use_gnu_as=
@@ -290,6 +291,38 @@ case ${with_newlib} in
yes) skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` ;;
esac
+# Handle --enable-gold.
+
+AC_ARG_ENABLE(gold,
+[ --enable-gold use gold instead of ld],
+ENABLE_GOLD=$enableval,
+ENABLE_GOLD=no)
+if test "${ENABLE_GOLD}" = "yes"; then
+ # Check for ELF target.
+ is_elf=no
+ case "${target}" in
+ *-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \
+ | *-*-linux* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \
+ | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-solaris2*)
+ case "${target}" in
+ *-*-linux*aout* | *-*-linux*oldld*)
+ ;;
+ *)
+ is_elf=yes
+ ;;
+ esac
+ esac
+
+ if test "$is_elf" = "yes"; then
+ # Check for target supported by gold.
+ case "${target}" in
+ i?86-*-* | x86_64-*-*)
+ configdirs="`echo " ${configdirs} " | sed -e 's/ ld / gold /'`"
+ ;;
+ esac
+ fi
+fi
+
# Configure extra directories which are host specific
case "${host}" in
@@ -1751,7 +1784,7 @@ if test x${use_gnu_as} = x &&
fi
if test x${use_gnu_ld} = x &&
- echo " ${configdirs} " | grep " ld " > /dev/null 2>&1 ; then
+ echo " ${configdirs} " | egrep " (go)?ld " > /dev/null 2>&1 ; then
with_gnu_ld=yes
extra_host_args="$extra_host_args --with-gnu-ld"
fi
Index: Makefile.def
===================================================================
--- Makefile.def (revision 133415)
+++ Makefile.def (working copy)
@@ -69,6 +69,7 @@ host_modules= { module= mpfr; lib_path=.
host="none-${host_vendor}-${host_os}";
target="none-${host_vendor}-${host_os}"; };
host_modules= { module= gnuserv; };
+host_modules= { module= gold; bootstrap=true; };
host_modules= { module= gprof; };
host_modules= { module= gzip; };
host_modules= { module= hello; };
@@ -287,6 +288,7 @@ dependencies = { module=configure-gcc; o
dependencies = { module=configure-gcc; on=all-binutils; };
dependencies = { module=configure-gcc; on=all-gas; };
dependencies = { module=configure-gcc; on=all-ld; };
+dependencies = { module=configure-gcc; on=all-gold; };
dependencies = { module=all-gcc; on=all-libiberty; hard=true; };
dependencies = { module=all-gcc; on=all-gmp; };
dependencies = { module=all-gcc; on=all-intl; };
@@ -374,6 +376,12 @@ dependencies = { module=all-ld; on=all-b
dependencies = { module=all-ld; on=all-build-byacc; };
dependencies = { module=all-ld; on=all-build-flex; };
dependencies = { module=all-ld; on=all-intl; };
+dependencies = { module=configure-gold; on=configure-intl; };
+dependencies = { module=all-gold; on=all-libiberty; };
+dependencies = { module=all-gold; on=all-intl; };
+dependencies = { module=all-gold; on=all-bfd; };
+dependencies = { module=all-gold; on=all-build-bison; };
+dependencies = { module=all-gold; on=all-build-byacc; };
dependencies = { module=configure-opcodes; on=configure-intl; };
dependencies = { module=all-opcodes; on=all-bfd; };