mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-08-02 07:27:49 +00:00
gcc:
- add bfd and gold patch
This commit is contained in:
parent
0eb8547726
commit
aad16ba2a0
@ -0,0 +1,767 @@
|
||||
diff -Naur gcc-4.5-20100520-old/configure gcc-4.5-20100520-new/configure
|
||||
--- gcc-4.5-20100520-old/configure 2010-04-20 03:19:57.000000000 -0700
|
||||
+++ gcc-4.5-20100520-new/configure 2010-05-27 19:23:50.000000000 -0700
|
||||
@@ -1483,7 +1483,7 @@
|
||||
--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={both}[[/{gold,ld}]]]
|
||||
--enable-libada build libada directory
|
||||
--enable-libssp build libssp directory
|
||||
--enable-build-with-cxx build with C++ compiler instead of C compiler
|
||||
@@ -2901,7 +2901,7 @@
|
||||
# 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".
|
||||
+# If --enable-gold is used, "gold" may replace "ld".
|
||||
host_tools="texinfo byacc flex bison binutils gas ld fixincludes gcc cgen 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.
|
||||
@@ -3069,6 +3069,11 @@
|
||||
esac
|
||||
|
||||
# Handle --enable-gold.
|
||||
+# --enable-gold Build only gold
|
||||
+# --disable-gold [default] Build only ld
|
||||
+# --enable-gold=both Build both gold and ld, ld is default
|
||||
+# --enable-gold=both/ld Same
|
||||
+# --enable-gold=both/gold Build both gold and ld, gold is default, ld is renamed ld.bfd
|
||||
|
||||
# Check whether --enable-gold was given.
|
||||
if test "${enable_gold+set}" = set; then :
|
||||
@@ -3077,32 +3082,47 @@
|
||||
ENABLE_GOLD=no
|
||||
fi
|
||||
|
||||
-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* | *-*-nto*)
|
||||
+ case "${ENABLE_GOLD}" in
|
||||
+ yes|both|both/gold|both/ld)
|
||||
+ # 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* | *-*-nto*)
|
||||
+ 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
|
||||
- *-*-linux*aout* | *-*-linux*oldld*)
|
||||
- ;;
|
||||
- *)
|
||||
- is_elf=yes
|
||||
+ i?86-*-* | x86_64-*-* | sparc*-*-* | powerpc*-*-* | arm*-*-*)
|
||||
+ case "${ENABLE_GOLD}" in
|
||||
+ both*)
|
||||
+ configdirs="$configdirs gold"
|
||||
+ ;;
|
||||
+ *)
|
||||
+ configdirs="`echo " ${configdirs} " | sed -e 's/ ld / gold /'`"
|
||||
+ ;;
|
||||
+ esac
|
||||
+ ENABLE_GOLD=yes
|
||||
;;
|
||||
esac
|
||||
+ fi
|
||||
+ ;;
|
||||
+ no)
|
||||
+ ;;
|
||||
+ *)
|
||||
+ as_fn_error "invalid --enable-gold argument" "$LINENO" 5
|
||||
+ ;;
|
||||
esac
|
||||
|
||||
- if test "$is_elf" = "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 /'`"
|
||||
- ;;
|
||||
- esac
|
||||
- fi
|
||||
-fi
|
||||
-
|
||||
# Configure extra directories which are host specific
|
||||
|
||||
case "${host}" in
|
||||
diff -Naur gcc-4.5-20100520-old/configure.ac gcc-4.5-20100520-new/configure.ac
|
||||
--- gcc-4.5-20100520-old/configure.ac 2010-04-20 03:19:57.000000000 -0700
|
||||
+++ gcc-4.5-20100520-new/configure.ac 2010-05-27 19:23:49.000000000 -0700
|
||||
@@ -174,7 +174,7 @@
|
||||
# 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".
|
||||
+# If --enable-gold is used, "gold" may replace "ld".
|
||||
host_tools="texinfo byacc flex bison binutils gas ld fixincludes gcc cgen 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.
|
||||
@@ -315,37 +315,57 @@
|
||||
esac
|
||||
|
||||
# Handle --enable-gold.
|
||||
+# --enable-gold Build only gold
|
||||
+# --disable-gold [default] Build only ld
|
||||
+# --enable-gold=both Build both gold and ld, ld is default
|
||||
+# --enable-gold=both/ld Same
|
||||
+# --enable-gold=both/gold Build both gold and ld, gold is default, ld is renamed ld.bfd
|
||||
|
||||
AC_ARG_ENABLE(gold,
|
||||
-[ --enable-gold use gold instead of ld],
|
||||
+[ --enable-gold[[=ARG]] build gold [[ARG={both}[[/{gold,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* | *-*-nto*)
|
||||
+ case "${ENABLE_GOLD}" in
|
||||
+ yes|both|both/gold|both/ld)
|
||||
+ # 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* | *-*-nto*)
|
||||
+ 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
|
||||
- *-*-linux*aout* | *-*-linux*oldld*)
|
||||
- ;;
|
||||
- *)
|
||||
- is_elf=yes
|
||||
+ i?86-*-* | x86_64-*-* | sparc*-*-* | powerpc*-*-* | arm*-*-*)
|
||||
+ case "${ENABLE_GOLD}" in
|
||||
+ both*)
|
||||
+ configdirs="$configdirs gold"
|
||||
+ ;;
|
||||
+ *)
|
||||
+ configdirs="`echo " ${configdirs} " | sed -e 's/ ld / gold /'`"
|
||||
+ ;;
|
||||
+ esac
|
||||
+ ENABLE_GOLD=yes
|
||||
;;
|
||||
esac
|
||||
+ fi
|
||||
+ ;;
|
||||
+ no)
|
||||
+ ;;
|
||||
+ *)
|
||||
+ AC_MSG_ERROR([invalid --enable-gold argument])
|
||||
+ ;;
|
||||
esac
|
||||
|
||||
- if test "$is_elf" = "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 /'`"
|
||||
- ;;
|
||||
- esac
|
||||
- fi
|
||||
-fi
|
||||
-
|
||||
# Configure extra directories which are host specific
|
||||
|
||||
case "${host}" in
|
||||
diff -Naur gcc-4.5-20100520-old/gcc/collect2.c gcc-4.5-20100520-new/gcc/collect2.c
|
||||
--- gcc-4.5-20100520-old/gcc/collect2.c 2010-04-27 13:14:19.000000000 -0700
|
||||
+++ gcc-4.5-20100520-new/gcc/collect2.c 2010-05-27 19:23:49.000000000 -0700
|
||||
@@ -1114,17 +1114,19 @@
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
- static const char *const ld_suffix = "ld";
|
||||
- static const char *const plugin_ld_suffix = PLUGIN_LD;
|
||||
- static const char *const real_ld_suffix = "real-ld";
|
||||
+ static const char *const ld_suffix = "ld";
|
||||
+ static const char *const gold_suffix = "gold";
|
||||
+ static const char *const bfd_ld_suffix = "ld.bfd";
|
||||
+ static const char *const plugin_ld_suffix = PLUGIN_LD;
|
||||
+ static const char *const real_ld_suffix = "real-ld";
|
||||
static const char *const collect_ld_suffix = "collect-ld";
|
||||
- static const char *const nm_suffix = "nm";
|
||||
- static const char *const gnm_suffix = "gnm";
|
||||
+ static const char *const nm_suffix = "nm";
|
||||
+ static const char *const gnm_suffix = "gnm";
|
||||
#ifdef LDD_SUFFIX
|
||||
- static const char *const ldd_suffix = LDD_SUFFIX;
|
||||
+ static const char *const ldd_suffix = LDD_SUFFIX;
|
||||
#endif
|
||||
- static const char *const strip_suffix = "strip";
|
||||
- static const char *const gstrip_suffix = "gstrip";
|
||||
+ static const char *const strip_suffix = "strip";
|
||||
+ static const char *const gstrip_suffix = "gstrip";
|
||||
|
||||
#ifdef CROSS_DIRECTORY_STRUCTURE
|
||||
/* If we look for a program in the compiler directories, we just use
|
||||
@@ -1134,6 +1136,10 @@
|
||||
|
||||
const char *const full_ld_suffix =
|
||||
concat(target_machine, "-", ld_suffix, NULL);
|
||||
+ const char *const full_gold_suffix =
|
||||
+ concat (target_machine, "-", gold_suffix, NULL);
|
||||
+ const char *const full_bfd_ld_suffix =
|
||||
+ concat (target_machine, "-", bfd_ld_suffix, NULL);
|
||||
const char *const full_plugin_ld_suffix =
|
||||
concat(target_machine, "-", plugin_ld_suffix, NULL);
|
||||
const char *const full_nm_suffix =
|
||||
@@ -1149,15 +1155,17 @@
|
||||
const char *const full_gstrip_suffix =
|
||||
concat (target_machine, "-", gstrip_suffix, NULL);
|
||||
#else
|
||||
- const char *const full_ld_suffix = ld_suffix;
|
||||
+ const char *const full_ld_suffix = ld_suffix;
|
||||
+ const char *const full_gold_suffix = gold_suffix;
|
||||
+ const char *const full_bfd_ld_suffix = bfd_ld_suffix;
|
||||
const char *const full_plugin_ld_suffix = plugin_ld_suffix;
|
||||
- const char *const full_nm_suffix = nm_suffix;
|
||||
- const char *const full_gnm_suffix = gnm_suffix;
|
||||
+ const char *const full_nm_suffix = nm_suffix;
|
||||
+ const char *const full_gnm_suffix = gnm_suffix;
|
||||
#ifdef LDD_SUFFIX
|
||||
- const char *const full_ldd_suffix = ldd_suffix;
|
||||
+ const char *const full_ldd_suffix = ldd_suffix;
|
||||
#endif
|
||||
- const char *const full_strip_suffix = strip_suffix;
|
||||
- const char *const full_gstrip_suffix = gstrip_suffix;
|
||||
+ const char *const full_strip_suffix = strip_suffix;
|
||||
+ const char *const full_gstrip_suffix = gstrip_suffix;
|
||||
#endif /* CROSS_DIRECTORY_STRUCTURE */
|
||||
|
||||
const char *arg;
|
||||
@@ -1171,7 +1179,13 @@
|
||||
const char **c_ptr;
|
||||
char **ld1_argv;
|
||||
const char **ld1;
|
||||
- bool use_plugin = false;
|
||||
+ enum linker_select
|
||||
+ {
|
||||
+ DFLT_LINKER,
|
||||
+ PLUGIN_LINKER,
|
||||
+ GOLD_LINKER,
|
||||
+ BFD_LINKER
|
||||
+ } selected_linker = DFLT_LINKER;
|
||||
|
||||
/* The kinds of symbols we will have to consider when scanning the
|
||||
outcome of a first pass link. This is ALL to start with, then might
|
||||
@@ -1188,7 +1202,6 @@
|
||||
int first_file;
|
||||
int num_c_args;
|
||||
char **old_argv;
|
||||
-
|
||||
bool use_verbose = false;
|
||||
|
||||
old_argv = argv;
|
||||
@@ -1244,22 +1257,29 @@
|
||||
{
|
||||
if (! strcmp (argv[i], "-debug"))
|
||||
debug = 1;
|
||||
- else if (! strcmp (argv[i], "-flto") && ! use_plugin)
|
||||
+ else if (! strcmp (argv[i], "-flto")
|
||||
+ && selected_linker != PLUGIN_LINKER)
|
||||
{
|
||||
use_verbose = true;
|
||||
lto_mode = LTO_MODE_LTO;
|
||||
}
|
||||
- else if (! strcmp (argv[i], "-fwhopr") && ! use_plugin)
|
||||
+ else if (! strcmp (argv[i], "-fwhopr")
|
||||
+ && selected_linker != PLUGIN_LINKER)
|
||||
{
|
||||
use_verbose = true;
|
||||
lto_mode = LTO_MODE_WHOPR;
|
||||
}
|
||||
else if (! strcmp (argv[i], "-plugin"))
|
||||
{
|
||||
- use_plugin = true;
|
||||
+ selected_linker = PLUGIN_LINKER;
|
||||
use_verbose = true;
|
||||
lto_mode = LTO_MODE_NONE;
|
||||
}
|
||||
+ else if (! strcmp (argv[i], "-use-gold"))
|
||||
+ selected_linker = GOLD_LINKER;
|
||||
+ else if (! strcmp (argv[i], "-use-ld"))
|
||||
+ selected_linker = BFD_LINKER;
|
||||
+
|
||||
#ifdef COLLECT_EXPORT_LIST
|
||||
/* since -brtl, -bexport, -b64 are not position dependent
|
||||
also check for them here */
|
||||
@@ -1339,35 +1359,108 @@
|
||||
/* Try to discover a valid linker/nm/strip to use. */
|
||||
|
||||
/* Maybe we know the right file to use (if not cross). */
|
||||
- ld_file_name = 0;
|
||||
+ ld_file_name = NULL;
|
||||
#ifdef DEFAULT_LINKER
|
||||
if (access (DEFAULT_LINKER, X_OK) == 0)
|
||||
ld_file_name = DEFAULT_LINKER;
|
||||
- if (ld_file_name == 0)
|
||||
+ if (ld_file_name == NULL)
|
||||
#endif
|
||||
#ifdef REAL_LD_FILE_NAME
|
||||
ld_file_name = find_a_file (&path, REAL_LD_FILE_NAME);
|
||||
- if (ld_file_name == 0)
|
||||
+ if (ld_file_name == NULL)
|
||||
#endif
|
||||
/* Search the (target-specific) compiler dirs for ld'. */
|
||||
ld_file_name = find_a_file (&cpath, real_ld_suffix);
|
||||
/* Likewise for `collect-ld'. */
|
||||
- if (ld_file_name == 0)
|
||||
+ if (ld_file_name == NULL)
|
||||
ld_file_name = find_a_file (&cpath, collect_ld_suffix);
|
||||
/* Search the compiler directories for `ld'. We have protection against
|
||||
recursive calls in find_a_file. */
|
||||
- if (ld_file_name == 0)
|
||||
- ld_file_name = find_a_file (&cpath,
|
||||
- use_plugin
|
||||
- ? plugin_ld_suffix
|
||||
- : ld_suffix);
|
||||
+ if (ld_file_name == NULL)
|
||||
+ switch (selected_linker)
|
||||
+ {
|
||||
+ default:
|
||||
+ case DFLT_LINKER:
|
||||
+ ld_file_name = find_a_file (&cpath, ld_suffix);
|
||||
+ break;
|
||||
+ case PLUGIN_LINKER:
|
||||
+ ld_file_name = find_a_file (&cpath, plugin_ld_suffix);
|
||||
+ break;
|
||||
+ case GOLD_LINKER:
|
||||
+ ld_file_name = find_a_file (&cpath, gold_suffix);
|
||||
+ break;
|
||||
+ case BFD_LINKER:
|
||||
+ ld_file_name = find_a_file (&cpath, bfd_ld_suffix);
|
||||
+ break;
|
||||
+ }
|
||||
/* Search the ordinary system bin directories
|
||||
for `ld' (if native linking) or `TARGET-ld' (if cross). */
|
||||
- if (ld_file_name == 0)
|
||||
- ld_file_name = find_a_file (&path,
|
||||
- use_plugin
|
||||
- ? full_plugin_ld_suffix
|
||||
- : full_ld_suffix);
|
||||
+ if (ld_file_name == NULL)
|
||||
+ switch (selected_linker)
|
||||
+ {
|
||||
+ default:
|
||||
+ case DFLT_LINKER:
|
||||
+ ld_file_name = find_a_file (&path, full_ld_suffix);
|
||||
+ break;
|
||||
+ case PLUGIN_LINKER:
|
||||
+ ld_file_name = find_a_file (&path, full_plugin_ld_suffix);
|
||||
+ break;
|
||||
+ case GOLD_LINKER:
|
||||
+ ld_file_name = find_a_file (&path, full_gold_suffix);
|
||||
+ break;
|
||||
+ case BFD_LINKER:
|
||||
+ ld_file_name = find_a_file (&path, full_bfd_ld_suffix);
|
||||
+ break;
|
||||
+ }
|
||||
+ /* If we failed to find a plugin-capable linker, try the ordinary one. */
|
||||
+ if (ld_file_name == NULL && selected_linker == PLUGIN_LINKER)
|
||||
+ ld_file_name = find_a_file (&cpath, ld_suffix);
|
||||
+
|
||||
+ if ((vflag || debug) && ld_file_name == NULL)
|
||||
+ {
|
||||
+ struct prefix_list * p;
|
||||
+ const char * s;
|
||||
+
|
||||
+ notice ("collect2: warning: unable to find linker.\n");
|
||||
+
|
||||
+#ifdef DEFAULT_LINKER
|
||||
+ notice (" Searched for this absolute executable:\n");
|
||||
+ notice (" %s\n", DEFAULT_LINKER);
|
||||
+#endif
|
||||
+
|
||||
+ notice (" Searched in these paths:\n");
|
||||
+ for (p = cpath.plist; p != NULL; p = p->next)
|
||||
+ notice (" %s\n", p->prefix);
|
||||
+ notice (" For these executables:\n");
|
||||
+ notice (" %s\n", real_ld_suffix);
|
||||
+ notice (" %s\n", collect_ld_suffix);
|
||||
+ switch (selected_linker)
|
||||
+ {
|
||||
+ default:
|
||||
+ case DFLT_LINKER: s = ld_suffix; break;
|
||||
+ case PLUGIN_LINKER: s = plugin_ld_suffix; break;
|
||||
+ case GOLD_LINKER: s = gold_suffix; break;
|
||||
+ case BFD_LINKER: s = bfd_ld_suffix; break;
|
||||
+ }
|
||||
+ notice (" %s\n", s);
|
||||
+
|
||||
+ notice (" And searched in these paths:\n");
|
||||
+ for (p = path.plist; p != NULL; p = p->next)
|
||||
+ notice (" %s\n", p->prefix);
|
||||
+ notice (" For these executables:\n");
|
||||
+#ifdef REAL_LD_FILE_NAME
|
||||
+ notice (" %s\n", REAL_LD_FILE_NAME);
|
||||
+#endif
|
||||
+ switch (selected_linker)
|
||||
+ {
|
||||
+ default:
|
||||
+ case DFLT_LINKER: s = full_ld_suffix; break;
|
||||
+ case PLUGIN_LINKER: s = full_plugin_ld_suffix; break;
|
||||
+ case GOLD_LINKER: s = full_gold_suffix; break;
|
||||
+ case BFD_LINKER: s = full_bfd_ld_suffix; break;
|
||||
+ }
|
||||
+ notice (" %s\n", s);
|
||||
+ }
|
||||
|
||||
#ifdef REAL_NM_FILE_NAME
|
||||
nm_file_name = find_a_file (&path, REAL_NM_FILE_NAME);
|
||||
diff -Naur gcc-4.5-20100520-old/gcc/common.opt gcc-4.5-20100520-new/gcc/common.opt
|
||||
--- gcc-4.5-20100520-old/gcc/common.opt 2010-03-17 20:01:09.000000000 -0700
|
||||
+++ gcc-4.5-20100520-new/gcc/common.opt 2010-05-27 19:23:49.000000000 -0700
|
||||
@@ -1401,6 +1401,9 @@
|
||||
Common Report Var(flag_unwind_tables) Optimization
|
||||
Just generate unwind tables for exception handling
|
||||
|
||||
+fuse-ld=
|
||||
+Common Joined Undocumented
|
||||
+
|
||||
fuse-linker-plugin
|
||||
Common Undocumented
|
||||
|
||||
diff -Naur gcc-4.5-20100520-old/gcc/configure gcc-4.5-20100520-new/gcc/configure
|
||||
--- gcc-4.5-20100520-old/gcc/configure 2010-05-19 10:32:43.000000000 -0700
|
||||
+++ gcc-4.5-20100520-new/gcc/configure 2010-05-27 19:23:52.000000000 -0700
|
||||
@@ -682,6 +682,7 @@
|
||||
gcc_cv_objdump
|
||||
ORIGINAL_NM_FOR_TARGET
|
||||
gcc_cv_nm
|
||||
+ORIGINAL_GOLD_FOR_TARGET
|
||||
ORIGINAL_LD_FOR_TARGET
|
||||
ORIGINAL_PLUGIN_LD_FOR_TARGET
|
||||
gcc_cv_ld
|
||||
@@ -17053,7 +17054,7 @@
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
-#line 17056 "configure"
|
||||
+#line 17057 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@@ -17159,7 +17160,7 @@
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
-#line 17162 "configure"
|
||||
+#line 17163 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@@ -20607,6 +20608,21 @@
|
||||
fi
|
||||
fi
|
||||
|
||||
+gcc_cv_ld_gold_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gold
|
||||
+
|
||||
+if test "${gcc_cv_gold+set}" = set; then :
|
||||
+
|
||||
+else
|
||||
+
|
||||
+if test -f $gcc_cv_ld_gold_srcdir/configure.ac \
|
||||
+ && test -f ../gold/Makefile \
|
||||
+ && test x$build = x$host; then
|
||||
+ gcc_cv_gold=../gold/ld-new$build_exeext
|
||||
+else
|
||||
+ gcc_cv_gold=''
|
||||
+fi
|
||||
+fi
|
||||
+
|
||||
ORIGINAL_PLUGIN_LD_FOR_TARGET=$gcc_cv_ld
|
||||
PLUGIN_LD=`basename $gcc_cv_ld`
|
||||
|
||||
@@ -20633,6 +20649,9 @@
|
||||
;;
|
||||
esac
|
||||
|
||||
+ORIGINAL_GOLD_FOR_TARGET=$gcc_cv_gold
|
||||
+
|
||||
+
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking what linker to use" >&5
|
||||
$as_echo_n "checking what linker to use... " >&6; }
|
||||
if test "$gcc_cv_ld" = ../ld/ld-new$build_exeext; then
|
||||
diff -Naur gcc-4.5-20100520-old/gcc/configure.ac gcc-4.5-20100520-new/gcc/configure.ac
|
||||
--- gcc-4.5-20100520-old/gcc/configure.ac 2010-05-19 10:32:43.000000000 -0700
|
||||
+++ gcc-4.5-20100520-new/gcc/configure.ac 2010-05-27 19:23:49.000000000 -0700
|
||||
@@ -1931,6 +1931,17 @@
|
||||
AC_PATH_PROG(gcc_cv_ld, $LD_FOR_TARGET)
|
||||
fi])
|
||||
|
||||
+gcc_cv_ld_gold_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gold
|
||||
+
|
||||
+AS_VAR_SET_IF(gcc_cv_gold,, [
|
||||
+if test -f $gcc_cv_ld_gold_srcdir/configure.ac \
|
||||
+ && test -f ../gold/Makefile \
|
||||
+ && test x$build = x$host; then
|
||||
+ gcc_cv_gold=../gold/ld-new$build_exeext
|
||||
+else
|
||||
+ gcc_cv_gold=''
|
||||
+fi])
|
||||
+
|
||||
ORIGINAL_PLUGIN_LD_FOR_TARGET=$gcc_cv_ld
|
||||
PLUGIN_LD=`basename $gcc_cv_ld`
|
||||
AC_ARG_WITH(plugin-ld,
|
||||
@@ -1949,6 +1960,9 @@
|
||||
*) AC_CONFIG_FILES(collect-ld:exec-tool.in, [chmod +x collect-ld]) ;;
|
||||
esac
|
||||
|
||||
+ORIGINAL_GOLD_FOR_TARGET=$gcc_cv_gold
|
||||
+AC_SUBST(ORIGINAL_GOLD_FOR_TARGET)
|
||||
+
|
||||
AC_MSG_CHECKING(what linker to use)
|
||||
if test "$gcc_cv_ld" = ../ld/ld-new$build_exeext; then
|
||||
# Single tree build which includes ld. We want to prefer it
|
||||
diff -Naur gcc-4.5-20100520-old/gcc/doc/invoke.texi gcc-4.5-20100520-new/gcc/doc/invoke.texi
|
||||
--- gcc-4.5-20100520-old/gcc/doc/invoke.texi 2010-04-06 07:02:22.000000000 -0700
|
||||
+++ gcc-4.5-20100520-new/gcc/doc/invoke.texi 2010-05-27 19:23:49.000000000 -0700
|
||||
@@ -390,7 +390,7 @@
|
||||
-funit-at-a-time -funroll-all-loops -funroll-loops @gol
|
||||
-funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
|
||||
-fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb @gol
|
||||
--fwhole-program -fwhopr -fwpa -fuse-linker-plugin @gol
|
||||
+-fwhole-program -fwhopr -fwpa -fuse-linker-plugin -fuse-ld @gol
|
||||
--param @var{name}=@var{value}
|
||||
-O -O0 -O1 -O2 -O3 -Os}
|
||||
|
||||
@@ -7415,6 +7415,16 @@
|
||||
|
||||
Disabled by default.
|
||||
|
||||
+@item -fuse-ld=gold
|
||||
+Use the @command{gold} linker instead of the default linker.
|
||||
+This option is only necessary if GCC has been configured with
|
||||
+@option{--enable-gold=both} or @option{--enable-gold=both/ld}.
|
||||
+
|
||||
+@item -fuse-ld=bfd
|
||||
+Use the @command{ld.bfd} linker instead of the default linker.
|
||||
+This option is only necessary if GCC has been configured with
|
||||
+@option{--enable-gold=both/gold}.
|
||||
+
|
||||
@item -fcprop-registers
|
||||
@opindex fcprop-registers
|
||||
After register allocation and post-register allocation instruction splitting,
|
||||
diff -Naur gcc-4.5-20100520-old/gcc/exec-tool.in gcc-4.5-20100520-new/gcc/exec-tool.in
|
||||
--- gcc-4.5-20100520-old/gcc/exec-tool.in 2009-11-08 14:36:51.000000000 -0800
|
||||
+++ gcc-4.5-20100520-new/gcc/exec-tool.in 2010-05-27 19:23:49.000000000 -0700
|
||||
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
|
||||
-# Copyright (C) 2007, 2008 Free Software Foundation, Inc.
|
||||
+# Copyright (C) 2007, 2008, 2010 Free Software Foundation, Inc.
|
||||
# This file is part of GCC.
|
||||
|
||||
# GCC is free software; you can redistribute it and/or modify
|
||||
@@ -21,11 +21,13 @@
|
||||
|
||||
ORIGINAL_AS_FOR_TARGET="@ORIGINAL_AS_FOR_TARGET@"
|
||||
ORIGINAL_LD_FOR_TARGET="@ORIGINAL_LD_FOR_TARGET@"
|
||||
+ORIGINAL_GOLD_FOR_TARGET="@ORIGINAL_GOLD_FOR_TARGET@"
|
||||
ORIGINAL_PLUGIN_LD_FOR_TARGET="@ORIGINAL_PLUGIN_LD_FOR_TARGET@"
|
||||
ORIGINAL_NM_FOR_TARGET="@ORIGINAL_NM_FOR_TARGET@"
|
||||
exeext=@host_exeext@
|
||||
fast_install=@enable_fast_install@
|
||||
objdir=@objdir@
|
||||
+version="1.1"
|
||||
|
||||
invoked=`basename "$0"`
|
||||
case "$invoked" in
|
||||
@@ -34,54 +36,110 @@
|
||||
prog=as-new$exeext
|
||||
dir=gas
|
||||
;;
|
||||
- collect-ld)
|
||||
- # when using a linker plugin, gcc will always pass '-plugin' as the
|
||||
- # first option to the linker.
|
||||
- if test x"$1" = "x-plugin"; then
|
||||
- original=$ORIGINAL_PLUGIN_LD_FOR_TARGET
|
||||
- else
|
||||
- original=$ORIGINAL_LD_FOR_TARGET
|
||||
- fi
|
||||
- prog=ld-new$exeext
|
||||
- dir=ld
|
||||
- ;;
|
||||
nm)
|
||||
original=$ORIGINAL_NM_FOR_TARGET
|
||||
prog=nm-new$exeext
|
||||
dir=binutils
|
||||
;;
|
||||
+ collect-ld)
|
||||
+ prog=ld-new$exeext
|
||||
+ # Look for the a command line option
|
||||
+ # specifying the linker to be used.
|
||||
+ case " $* " in
|
||||
+ *\ -use-gold\ *)
|
||||
+ original=$ORIGINAL_GOLD_FOR_TARGET
|
||||
+ dir=gold
|
||||
+ ;;
|
||||
+ *\ -use-ld\ * | *\ -use-ld.bfd\ *)
|
||||
+ original=$ORIGINAL_LD_FOR_TARGET
|
||||
+ dir=ld
|
||||
+ ;;
|
||||
+ *\ -plugin\ *)
|
||||
+ original=$ORIGINAL_PLUGIN_LD_FOR_TARGET
|
||||
+ dir=ld
|
||||
+ ;;
|
||||
+ *)
|
||||
+ original=$ORIGINAL_LD_FOR_TARGET
|
||||
+ dir=ld
|
||||
+ ;;
|
||||
+ esac
|
||||
+
|
||||
+ # If the selected linker has not been configured then
|
||||
+ # try using the others, in the order PLUGIN-LD, LD, GOLD.
|
||||
+ if test x"$original" = x; then
|
||||
+ if test x"$ORIGINAL_PLUGIN_LD_FOR_TARGET" != x; then
|
||||
+ original=$ORIGINAL_PLUGIN_LD_FOR_TARGET
|
||||
+ dir=ld
|
||||
+ elif test x"$ORIGINAL_LD_FOR_TARGET" != x; then
|
||||
+ original=$ORIGINAL_LD_FOR_TARGET
|
||||
+ dir=ld
|
||||
+ elif test x"$ORIGINAL_GOLD_FOR_TARGET" != x; then
|
||||
+ original=$ORIGINAL_GOLD_FOR_TARGET
|
||||
+ dir=gold
|
||||
+ # Otherwise do nothing - the case statement below
|
||||
+ # will issue an error message for us.
|
||||
+ fi
|
||||
+ fi
|
||||
+ ;;
|
||||
esac
|
||||
|
||||
case "$original" in
|
||||
../*)
|
||||
- # compute absolute path of the location of this script
|
||||
+ # Compute absolute path to the location of this script.
|
||||
tdir=`dirname "$0"`
|
||||
scriptdir=`cd "$tdir" && pwd`
|
||||
|
||||
if test -x $scriptdir/../$dir/$prog; then
|
||||
- test "$fast_install" = yes || exec $scriptdir/../$dir/$prog ${1+"$@"}
|
||||
-
|
||||
- # if libtool did everything it needs to do, there's a fast path
|
||||
- lt_prog=$scriptdir/../$dir/$objdir/lt-$prog
|
||||
- test -x $lt_prog && exec $lt_prog ${1+"$@"}
|
||||
-
|
||||
- # libtool has not relinked ld-new yet, but we cannot just use the
|
||||
- # previous stage (because then the relinking would just never happen!).
|
||||
- # So we take extra care to use prev-ld/ld-new *on recursive calls*.
|
||||
- test x"$LT_RCU" = x"1" && exec $scriptdir/../prev-$dir/$prog ${1+"$@"}
|
||||
-
|
||||
- LT_RCU=1; export LT_RCU
|
||||
- $scriptdir/../$dir/$prog ${1+"$@"}
|
||||
- result=$?
|
||||
- exit $result
|
||||
-
|
||||
+ if test "$fast_install" = yes; then
|
||||
+ # If libtool did everything it needs to do, there's a fast path.
|
||||
+ lt_prog=$scriptdir/../$dir/$objdir/lt-$prog
|
||||
+
|
||||
+ if test -x $lt_prog; then
|
||||
+ original=$lt_prog
|
||||
+ else
|
||||
+ # Libtool has not relinked ld-new yet, but we cannot just use the
|
||||
+ # previous stage (because then the relinking would just never happen!).
|
||||
+ # So we take extra care to use prev-ld/ld-new *on recursive calls*.
|
||||
+ if test x"$LT_RCU" = x"1"; then
|
||||
+ original=$scriptdir/../prev-$dir/$prog
|
||||
+ else
|
||||
+ LT_RCU=1; export LT_RCU
|
||||
+ case " $* " in
|
||||
+ *\ -v\ *)
|
||||
+ echo "$invoked $version"
|
||||
+ echo $scriptdir/../$dir/$prog $*
|
||||
+ ;;
|
||||
+ esac
|
||||
+ $scriptdir/../$dir/$prog ${1+"$@"}
|
||||
+ result=$?
|
||||
+ exit $result
|
||||
+ fi
|
||||
+ fi
|
||||
+ else
|
||||
+ original=$scriptdir/../$dir/$prog
|
||||
+ fi
|
||||
else
|
||||
- exec $scriptdir/../prev-$dir/$prog ${1+"$@"}
|
||||
+ original=$scriptdir/../prev-$dir/$prog
|
||||
fi
|
||||
;;
|
||||
- *)
|
||||
- exec "$original" ${1+"$@"}
|
||||
+ "")
|
||||
+ echo "$invoked: executable not configured"
|
||||
+ exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
+# If -v has been used then display our version number
|
||||
+# and then echo the command we are about to invoke.
|
||||
+case " $* " in
|
||||
+ *\ -v\ *)
|
||||
+ echo "$invoked $version"
|
||||
+ echo $original $*
|
||||
+ ;;
|
||||
+esac
|
||||
|
||||
+if test -x $original; then
|
||||
+ exec "$original" ${1+"$@"}
|
||||
+else
|
||||
+ echo "$invoked: unable to locate executable: $original"
|
||||
+ exit 1
|
||||
+fi
|
||||
diff -Naur gcc-4.5-20100520-old/gcc/gcc.c gcc-4.5-20100520-new/gcc/gcc.c
|
||||
--- gcc-4.5-20100520-old/gcc/gcc.c 2010-04-18 10:46:08.000000000 -0700
|
||||
+++ gcc-4.5-20100520-new/gcc/gcc.c 2010-05-27 19:23:49.000000000 -0700
|
||||
@@ -790,6 +790,9 @@
|
||||
%{v:-plugin-opt=-v} \
|
||||
} \
|
||||
%{flto} %{fwhopr} %l " LINK_PIE_SPEC \
|
||||
+ "%{fuse-ld=gold:%{fuse-ld=bfd:%e-fuse-ld=gold and -fuse-ld=bfd may not be used together}} \
|
||||
+ %{fuse-ld=gold:-use-gold} \
|
||||
+ %{fuse-ld=bfd:-use-ld}" \
|
||||
"%X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}\
|
||||
%{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
|
||||
%{static:} %{L*} %(mfwrap) %(link_libgcc) %o\
|
||||
diff -Naur gcc-4.5-20100520-old/gcc/opts.c gcc-4.5-20100520-new/gcc/opts.c
|
||||
--- gcc-4.5-20100520-old/gcc/opts.c 2010-05-17 03:13:28.000000000 -0700
|
||||
+++ gcc-4.5-20100520-new/gcc/opts.c 2010-05-27 19:23:49.000000000 -0700
|
||||
@@ -2138,8 +2138,9 @@
|
||||
/* These are no-ops, preserved for backward compatibility. */
|
||||
break;
|
||||
|
||||
+ case OPT_fuse_ld_:
|
||||
case OPT_fuse_linker_plugin:
|
||||
- /* No-op. Used by the driver and passed to us because it starts with f.*/
|
||||
+ /* No-op. Used by the driver and passed to us because it starts with f. */
|
||||
break;
|
||||
|
||||
default:
|
Loading…
x
Reference in New Issue
Block a user