gcc: update to gcc-4.6.2

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2011-10-31 09:50:47 +01:00
parent 959004d94c
commit 8b9d9789a4
8 changed files with 128 additions and 435 deletions

View File

@ -49,9 +49,11 @@ mkdir -p objdir-$1 && cd objdir-$1
--disable-__cxa_atexit \
--disable-libada \
--disable-libmudflap \
--enable-gold=both/ld \
--enable-gold=yes \
--enable-ld=default \
--enable-plugin \
--enable-lto \
--disable-libquadmath \
--disable-libssp \
--disable-libgomp \
--disable-shared \

View File

@ -49,9 +49,11 @@ mkdir -p objdir-$1 && cd objdir-$1
--disable-libmudflap \
--disable-libssp \
--disable-multilib \
--enable-gold=both/ld \
--enable-gold=yes \
--enable-ld=default \
--enable-plugin \
--enable-lto \
--disable-libquadmath \
--enable-tls \
--enable-shared \
--enable-c99 \
@ -61,11 +63,6 @@ mkdir -p objdir-$1 && cd objdir-$1
make
if [ ! "$DEBUG" = yes ]; then
$STRIP `find . -name "*.so"`
$STRIP `find . -name "*.so.[0-9]*"`
fi
make install
cp -PR $TARGET_NAME/libstdc++-v3/src/.libs/libstdc++.so* $SYSROOT_PREFIX/usr/lib

View File

@ -19,7 +19,7 @@
################################################################################
PKG_NAME="gcc"
PKG_VERSION="4.5.3"
PKG_VERSION="4.6.2"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"

View File

@ -1,126 +0,0 @@
diff -Naur gcc-4.5-20101118/gcc/ChangeLog gcc-4.5-20101118.patch/gcc/ChangeLog
diff -Naur gcc-4.5-20101118/gcc/doc/invoke.texi gcc-4.5-20101118.patch/gcc/doc/invoke.texi
--- gcc-4.5-20101118/gcc/doc/invoke.texi 2010-09-08 19:36:40.000000000 +0200
+++ gcc-4.5-20101118.patch/gcc/doc/invoke.texi 2010-11-26 03:05:14.029157093 +0100
@@ -9382,6 +9382,18 @@
%@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
@end smallexample
+@item @code{pass-through-libs}
+The @code{pass-through-libs} spec function takes any number of arguments. It
+finds any @option{-l} options and any non-options ending in ".a" (which it
+assumes are the names of linker input library archive files) and returns a
+result containing all the found arguments each prepended by
+@option{-plugin-opt=-pass-through=} and joined by spaces. This list is
+intended to be passed to the LTO linker plugin.
+
+@smallexample
+%:pass-through-libs(%G %L %G)
+@end smallexample
+
@item @code{print-asm-header}
The @code{print-asm-header} function takes no arguments and simply
prints a banner like:
diff -Naur gcc-4.5-20101118/gcc/gcc.c gcc-4.5-20101118.patch/gcc/gcc.c
--- gcc-4.5-20101118/gcc/gcc.c 2010-04-18 19:46:08.000000000 +0200
+++ gcc-4.5-20101118.patch/gcc/gcc.c 2010-11-26 03:03:47.120008881 +0100
@@ -407,6 +407,7 @@
static const char *compare_debug_dump_opt_spec_function (int, const char **);
static const char *compare_debug_self_opt_spec_function (int, const char **);
static const char *compare_debug_auxbase_opt_spec_function (int, const char **);
+static const char *pass_through_libs_spec_func (int, const char **);
/* The Specs Language
@@ -781,8 +782,7 @@
-plugin %(linker_plugin_file) \
-plugin-opt=%(lto_wrapper) \
-plugin-opt=%(lto_gcc) \
- %{static|static-libgcc:-plugin-opt=-pass-through=%(lto_libgcc)} \
- %{static:-plugin-opt=-pass-through=-lc} \
+ %{!nostdlib:%{!nodefaultlibs:%:pass-through-libs(%(link_gcc_c_sequence))}} \
%{O*:-plugin-opt=-O%*} \
%{w:-plugin-opt=-w} \
%{f*:-plugin-opt=-f%*} \
@@ -841,7 +841,6 @@
static const char *linker_plugin_file_spec = "";
static const char *lto_wrapper_spec = "";
static const char *lto_gcc_spec = "";
-static const char *lto_libgcc_spec = "";
static const char *link_command_spec = LINK_COMMAND_SPEC;
static const char *link_libgcc_spec = LINK_LIBGCC_SPEC;
static const char *startfile_prefix_spec = STARTFILE_PREFIX_SPEC;
@@ -1688,7 +1687,6 @@
INIT_STATIC_SPEC ("linker_plugin_file", &linker_plugin_file_spec),
INIT_STATIC_SPEC ("lto_wrapper", &lto_wrapper_spec),
INIT_STATIC_SPEC ("lto_gcc", &lto_gcc_spec),
- INIT_STATIC_SPEC ("lto_libgcc", &lto_libgcc_spec),
INIT_STATIC_SPEC ("link_libgcc", &link_libgcc_spec),
INIT_STATIC_SPEC ("md_exec_prefix", &md_exec_prefix),
INIT_STATIC_SPEC ("md_startfile_prefix", &md_startfile_prefix),
@@ -1730,6 +1728,7 @@
{ "compare-debug-dump-opt", compare_debug_dump_opt_spec_function },
{ "compare-debug-self-opt", compare_debug_self_opt_spec_function },
{ "compare-debug-auxbase-opt", compare_debug_auxbase_opt_spec_function },
+ { "pass-through-libs", pass_through_libs_spec_func },
#ifdef EXTRA_SPEC_FUNCTIONS
EXTRA_SPEC_FUNCTIONS
#endif
@@ -7580,10 +7579,6 @@
if (!linker_plugin_file_spec)
fatal ("-fuse-linker-plugin, but liblto_plugin.so not found");
- lto_libgcc_spec = find_a_file (&startfile_prefixes, "libgcc.a",
- R_OK, true);
- if (!lto_libgcc_spec)
- fatal ("could not find libgcc.a");
}
lto_gcc_spec = argv[0];
@@ -8977,3 +8972,46 @@
return name;
}
+
+/* %:pass-through-libs spec function. Finds all -l options and input
+ file names in the lib spec passed to it, and makes a list of them
+ prepended with the plugin option to cause them to be passed through
+ to the final link after all the new object files have been added. */
+
+const char *
+pass_through_libs_spec_func (int argc, const char **argv)
+{
+ char *prepended = xstrdup (" ");
+ int n;
+ /* Shlemiel the painter's algorithm. Innately horrible, but at least
+ we know that there will never be more than a handful of strings to
+ concat, and it's only once per run, so it's not worth optimising. */
+ for (n = 0; n < argc; n++)
+ {
+ char *old = prepended;
+ /* Anything that isn't an option is a full path to an output
+ file; pass it through if it ends in '.a'. Among options,
+ pass only -l. */
+ if (argv[n][0] == '-' && argv[n][1] == 'l')
+ {
+ const char *lopt = argv[n] + 2;
+ /* Handle both joined and non-joined -l options. If for any
+ reason there's a trailing -l with no joined or following
+ arg just discard it. */
+ if (!*lopt && ++n >= argc)
+ break;
+ else if (!*lopt)
+ lopt = argv[n];
+ prepended = concat (prepended, "-plugin-opt=-pass-through=-l",
+ lopt, " ", NULL);
+ }
+ else if (!strcmp (".a", argv[n] + strlen (argv[n]) - 2))
+ {
+ prepended = concat (prepended, "-plugin-opt=-pass-through=",
+ argv[n], " ", NULL);
+ }
+ if (prepended != old)
+ free (old);
+ }
+ return prepended;
+}

View File

@ -1,99 +1,7 @@
diff -Naur gcc-4.5-20101118/configure.ac gcc-4.5-20101118.patch/configure.ac
--- gcc-4.5-20101118/configure.ac 2010-10-06 12:29:55.000000000 +0200
+++ gcc-4.5-20101118.patch/configure.ac 2010-11-26 03:48:17.007444557 +0100
@@ -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-20101118/gcc/collect2.c gcc-4.5-20101118.patch/gcc/collect2.c
--- gcc-4.5-20101118/gcc/collect2.c 2010-06-24 23:06:37.000000000 +0200
+++ gcc-4.5-20101118.patch/gcc/collect2.c 2010-11-26 03:42:31.162881405 +0100
@@ -1114,17 +1114,19 @@
diff -Naur gcc-4.6.0-old/gcc/collect2.c gcc-4.6.0-new/gcc/collect2.c
--- gcc-4.6.0-old/gcc/collect2.c 2011-01-06 10:50:20.000000000 -0800
+++ gcc-4.6.0-new/gcc/collect2.c 2011-03-28 21:52:29.000000000 -0700
@@ -1075,17 +1075,19 @@
int
main (int argc, char **argv)
{
@ -121,7 +29,7 @@ diff -Naur gcc-4.5-20101118/gcc/collect2.c gcc-4.5-20101118.patch/gcc/collect2.c
#ifdef CROSS_DIRECTORY_STRUCTURE
/* If we look for a program in the compiler directories, we just use
@@ -1134,6 +1136,10 @@
@@ -1095,6 +1097,10 @@
const char *const full_ld_suffix =
concat(target_machine, "-", ld_suffix, NULL);
@ -132,7 +40,7 @@ diff -Naur gcc-4.5-20101118/gcc/collect2.c gcc-4.5-20101118.patch/gcc/collect2.c
const char *const full_plugin_ld_suffix =
concat(target_machine, "-", plugin_ld_suffix, NULL);
const char *const full_nm_suffix =
@@ -1149,15 +1155,17 @@
@@ -1110,15 +1116,17 @@
const char *const full_gstrip_suffix =
concat (target_machine, "-", gstrip_suffix, NULL);
#else
@ -156,7 +64,7 @@ diff -Naur gcc-4.5-20101118/gcc/collect2.c gcc-4.5-20101118.patch/gcc/collect2.c
#endif /* CROSS_DIRECTORY_STRUCTURE */
const char *arg;
@@ -1171,7 +1179,13 @@
@@ -1132,7 +1140,13 @@
const char **c_ptr;
char **ld1_argv;
const char **ld1;
@ -171,37 +79,20 @@ diff -Naur gcc-4.5-20101118/gcc/collect2.c gcc-4.5-20101118.patch/gcc/collect2.c
/* 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")
@@ -1209,15 +1223,21 @@
else if (! strcmp (argv[i], "-flto-partition=none"))
no_partition = true;
else if ((! strncmp (argv[i], "-flto=", 6)
- || ! strcmp (argv[i], "-flto")) && ! use_plugin)
+ || ! 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;
}
lto_mode = LTO_MODE_WHOPR;
else if (!strncmp (argv[i], "-fno-lto", 8))
lto_mode = LTO_MODE_NONE;
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"))
@ -212,7 +103,7 @@ diff -Naur gcc-4.5-20101118/gcc/collect2.c gcc-4.5-20101118.patch/gcc/collect2.c
#ifdef COLLECT_EXPORT_LIST
/* since -brtl, -bexport, -b64 are not position dependent
also check for them here */
@@ -1339,35 +1359,108 @@
@@ -1299,35 +1319,108 @@
/* Try to discover a valid linker/nm/strip to use. */
/* Maybe we know the right file to use (if not cross). */
@ -335,10 +226,10 @@ diff -Naur gcc-4.5-20101118/gcc/collect2.c gcc-4.5-20101118.patch/gcc/collect2.c
#ifdef REAL_NM_FILE_NAME
nm_file_name = find_a_file (&path, REAL_NM_FILE_NAME);
diff -Naur gcc-4.5-20101118/gcc/common.opt gcc-4.5-20101118.patch/gcc/common.opt
--- gcc-4.5-20101118/gcc/common.opt 2010-03-18 04:01:09.000000000 +0100
+++ gcc-4.5-20101118.patch/gcc/common.opt 2010-11-26 03:42:31.164881431 +0100
@@ -1401,6 +1401,9 @@
diff -Naur gcc-4.6.0-old/gcc/common.opt gcc-4.6.0-new/gcc/common.opt
--- gcc-4.6.0-old/gcc/common.opt 2011-03-05 16:38:13.000000000 -0800
+++ gcc-4.6.0-new/gcc/common.opt 2011-03-28 21:52:29.000000000 -0700
@@ -2019,6 +2019,9 @@
Common Report Var(flag_unwind_tables) Optimization
Just generate unwind tables for exception handling
@ -348,71 +239,10 @@ diff -Naur gcc-4.5-20101118/gcc/common.opt gcc-4.5-20101118.patch/gcc/common.opt
fuse-linker-plugin
Common Undocumented
diff -Naur gcc-4.5-20101118/gcc/configure gcc-4.5-20101118.patch/gcc/configure
--- gcc-4.5-20101118/gcc/configure 2010-10-06 21:09:10.000000000 +0200
+++ gcc-4.5-20101118.patch/gcc/configure 2010-11-26 03:42:31.184881696 +0100
@@ -684,6 +684,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
@@ -17108,7 +17109,7 @@
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 17111 "configure"
+#line 17112 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -17214,7 +17215,7 @@
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 17217 "configure"
+#line 17218 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -20662,6 +20663,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`
@@ -20688,6 +20704,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-20101118/gcc/configure.ac gcc-4.5-20101118.patch/gcc/configure.ac
--- gcc-4.5-20101118/gcc/configure.ac 2010-10-06 21:09:10.000000000 +0200
+++ gcc-4.5-20101118.patch/gcc/configure.ac 2010-11-26 03:42:31.201881922 +0100
@@ -1947,6 +1947,17 @@
diff -Naur gcc-4.6.0-old/gcc/configure.ac gcc-4.6.0-new/gcc/configure.ac
--- gcc-4.6.0-old/gcc/configure.ac 2011-02-28 07:36:37.000000000 -0800
+++ gcc-4.6.0-new/gcc/configure.ac 2011-03-28 21:58:18.000000000 -0700
@@ -1937,6 +1937,17 @@
AC_PATH_PROG(gcc_cv_ld, $LD_FOR_TARGET)
fi])
@ -430,7 +260,7 @@ diff -Naur gcc-4.5-20101118/gcc/configure.ac gcc-4.5-20101118.patch/gcc/configur
ORIGINAL_PLUGIN_LD_FOR_TARGET=$gcc_cv_ld
PLUGIN_LD=`basename $gcc_cv_ld`
AC_ARG_WITH(plugin-ld,
@@ -1965,6 +1976,9 @@
@@ -1966,6 +1977,9 @@
*) AC_CONFIG_FILES(collect-ld:exec-tool.in, [chmod +x collect-ld]) ;;
esac
@ -440,44 +270,43 @@ diff -Naur gcc-4.5-20101118/gcc/configure.ac gcc-4.5-20101118.patch/gcc/configur
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-20101118/gcc/doc/invoke.texi gcc-4.5-20101118.patch/gcc/doc/invoke.texi
--- gcc-4.5-20101118/gcc/doc/invoke.texi 2010-09-08 19:36:40.000000000 +0200
+++ gcc-4.5-20101118.patch/gcc/doc/invoke.texi 2010-11-26 03:42:31.218882146 +0100
@@ -390,7 +390,7 @@
diff -Naur gcc-4.6.0-old/gcc/doc/invoke.texi gcc-4.6.0-new/gcc/doc/invoke.texi
--- gcc-4.6.0-old/gcc/doc/invoke.texi 2011-03-18 07:34:52.000000000 -0700
+++ gcc-4.6.0-new/gcc/doc/invoke.texi 2011-03-28 21:52:29.000000000 -0700
@@ -401,7 +401,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
--fwhole-program -fwpa -fuse-linker-plugin @gol
+-fwhole-program -fwpa -fuse-ld -fuse-linker-plugin @gol
--param @var{name}=@var{value}
-O -O0 -O1 -O2 -O3 -Os}
-O -O0 -O1 -O2 -O3 -Os -Ofast}
@@ -7416,6 +7416,16 @@
@@ -7743,6 +7743,16 @@
Disabled by default.
Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
+@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}.
+@option{--enable-gold} and @option{--enable-ld=default}.
+
+@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}.
+@option{--enable-gold} and @option{--enable-ld}.
+
@item -fcprop-registers
@opindex fcprop-registers
After register allocation and post-register allocation instruction splitting,
diff -Naur gcc-4.5-20101118/gcc/doc/invoke.texi.orig gcc-4.5-20101118.patch/gcc/doc/invoke.texi.orig
diff -Naur gcc-4.5-20101118/gcc/exec-tool.in gcc-4.5-20101118.patch/gcc/exec-tool.in
--- gcc-4.5-20101118/gcc/exec-tool.in 2009-11-08 23:36:51.000000000 +0100
+++ gcc-4.5-20101118.patch/gcc/exec-tool.in 2010-11-26 03:42:31.226882250 +0100
diff -Naur gcc-4.6.0-old/gcc/exec-tool.in gcc-4.6.0-new/gcc/exec-tool.in
--- gcc-4.6.0-old/gcc/exec-tool.in 2011-01-03 12:52:22.000000000 -0800
+++ gcc-4.6.0-new/gcc/exec-tool.in 2011-03-28 21:52:29.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.
-# Copyright (C) 2007, 2008, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2007, 2008, 2010, 2011 Free Software Foundation, Inc.
# This file is part of GCC.
# GCC is free software; you can redistribute it and/or modify
@ -494,29 +323,20 @@ diff -Naur gcc-4.5-20101118/gcc/exec-tool.in gcc-4.5-20101118.patch/gcc/exec-too
+version="1.1"
invoked=`basename "$0"`
case "$invoked" in
@@ -34,54 +36,110 @@
prog=as-new$exeext
id=$invoked
@@ -36,15 +38,44 @@
dir=gas
;;
- collect-ld)
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
- # first or second option to the linker.
- if test x"$1" = "x-plugin" || test x"$2" = "x-plugin"; then
- original=$ORIGINAL_PLUGIN_LD_FOR_TARGET
- else
- original=$ORIGINAL_LD_FOR_TARGET
- fi
- prog=ld-new$exeext
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
@ -554,14 +374,10 @@ diff -Naur gcc-4.5-20101118/gcc/exec-tool.in gcc-4.5-20101118.patch/gcc/exec-too
+ # 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"`
id=ld
;;
nm)
@@ -61,29 +92,58 @@
scriptdir=`cd "$tdir" && pwd`
if test -x $scriptdir/../$dir/$prog; then
@ -574,9 +390,11 @@ diff -Naur gcc-4.5-20101118/gcc/exec-tool.in gcc-4.5-20101118.patch/gcc/exec-too
- # 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*.
- eval LT_RCU="\${LT_RCU_$id}"
- test x"$LT_RCU" = x"1" && exec $scriptdir/../prev-$dir/$prog ${1+"$@"}
-
- LT_RCU=1; export LT_RCU
- eval LT_RCU_$id=1
- export LT_RCU_$id
- $scriptdir/../$dir/$prog ${1+"$@"}
- result=$?
- exit $result
@ -591,10 +409,12 @@ diff -Naur gcc-4.5-20101118/gcc/exec-tool.in gcc-4.5-20101118.patch/gcc/exec-too
+ # 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*.
+ eval LT_RCU="\${LT_RCU_$id}"
+ if test x"$LT_RCU" = x"1"; then
+ original=$scriptdir/../prev-$dir/$prog
+ else
+ LT_RCU=1; export LT_RCU
+ eval LT_RCU_$id=1
+ export LT_RCU_$id
+ case " $* " in
+ *\ -v\ *)
+ echo "$invoked $version"
@ -615,13 +435,13 @@ diff -Naur gcc-4.5-20101118/gcc/exec-tool.in gcc-4.5-20101118.patch/gcc/exec-too
fi
;;
- *)
- exec "$original" ${1+"$@"}
- 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
@ -630,31 +450,31 @@ diff -Naur gcc-4.5-20101118/gcc/exec-tool.in gcc-4.5-20101118.patch/gcc/exec-too
+ 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-20101118/gcc/gcc.c gcc-4.5-20101118.patch/gcc/gcc.c
--- gcc-4.5-20101118/gcc/gcc.c 2010-04-18 19:46:08.000000000 +0200
+++ gcc-4.5-20101118.patch/gcc/gcc.c 2010-11-26 03:42:31.230882305 +0100
@@ -790,6 +790,9 @@
%{v:-plugin-opt=-v} \
} \
%{flto} %{fwhopr} %l " LINK_PIE_SPEC \
diff -Naur gcc-4.6.0-old/gcc/gcc.c gcc-4.6.0-new/gcc/gcc.c
--- gcc-4.6.0-old/gcc/gcc.c 2011-02-22 18:04:43.000000000 -0800
+++ gcc-4.6.0-new/gcc/gcc.c 2011-03-28 21:52:29.000000000 -0700
@@ -657,6 +657,9 @@
}"PLUGIN_COND_CLOSE" \
%{flto|flto=*:%<fcompare-debug*} \
%{flto} %{flto=*} %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}}}\
"%X %{o*} %{e*} %{N} %{n} %{r}\
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}}\
%{static:} %{L*} %(mfwrap) %(link_libgcc) %o\
diff -Naur gcc-4.5-20101118/gcc/opts.c gcc-4.5-20101118.patch/gcc/opts.c
--- gcc-4.5-20101118/gcc/opts.c 2010-05-17 12:13:28.000000000 +0200
+++ gcc-4.5-20101118.patch/gcc/opts.c 2010-11-26 03:42:31.236882383 +0100
@@ -2138,8 +2138,9 @@
/* These are no-ops, preserved for backward compatibility. */
diff -Naur gcc-4.6.0-old/gcc/opts.c gcc-4.6.0-new/gcc/opts.c
--- gcc-4.6.0-old/gcc/opts.c 2011-02-17 14:51:57.000000000 -0800
+++ gcc-4.6.0-new/gcc/opts.c 2011-03-28 21:52:29.000000000 -0700
@@ -1692,8 +1692,9 @@
dc->max_errors = value;
break;
+ case OPT_fuse_ld_:

View File

@ -1,6 +1,6 @@
diff -Naur gcc-4.5-20100610-old/gcc/config/i386/t-linux64 gcc-4.5-20100610-new/gcc/config/i386/t-linux64
--- gcc-4.5-20100610-old/gcc/config/i386/t-linux64 2010-06-11 09:31:52.000000000 -0700
+++ gcc-4.5-20100610-new/gcc/config/i386/t-linux64 2010-06-11 09:39:52.000000000 -0700
diff -Naur gcc-4.6.0-old/gcc/config/i386/t-linux64 gcc-4.6.0-new/gcc/config/i386/t-linux64
--- gcc-4.6.0-old/gcc/config/i386/t-linux64 2009-04-21 12:03:23.000000000 -0700
+++ gcc-4.6.0-new/gcc/config/i386/t-linux64 2011-03-28 21:12:19.000000000 -0700
@@ -23,13 +23,13 @@
# it doesn't tell anything about the 32bit libraries on those systems. Set
# MULTILIB_OSDIRNAMES according to what is found on the target.

View File

@ -1,7 +1,7 @@
diff -Naur gcc-4.5-20100610-old/gcc/config/i386/linux64.h gcc-4.5-20100610-new/gcc/config/i386/linux64.h
--- gcc-4.5-20100610-old/gcc/config/i386/linux64.h 2010-06-11 09:40:14.000000000 -0700
+++ gcc-4.5-20100610-new/gcc/config/i386/linux64.h 2010-06-11 09:41:13.000000000 -0700
@@ -59,7 +59,7 @@
diff -Naur gcc-4.6.0-old/gcc/config/i386/linux64.h gcc-4.6.0-new/gcc/config/i386/linux64.h
--- gcc-4.6.0-old/gcc/config/i386/linux64.h 2011-03-28 21:06:17.000000000 -0700
+++ gcc-4.6.0-new/gcc/config/i386/linux64.h 2011-03-28 21:07:35.000000000 -0700
@@ -63,7 +63,7 @@
done. */
#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
@ -10,12 +10,12 @@ diff -Naur gcc-4.5-20100610-old/gcc/config/i386/linux64.h gcc-4.5-20100610-new/g
#if TARGET_64BIT_DEFAULT
#define SPEC_32 "m32"
diff -Naur gcc-4.5-20100610-old/gcc/config/mips/iris6.h gcc-4.5-20100610-new/gcc/config/mips/iris6.h
--- gcc-4.5-20100610-old/gcc/config/mips/iris6.h 2010-06-11 09:40:14.000000000 -0700
+++ gcc-4.5-20100610-new/gcc/config/mips/iris6.h 2010-06-11 09:41:13.000000000 -0700
@@ -88,27 +88,27 @@
%{mabi=32:%{pg:gcrt1.o%s} \
%{!pg:%{p:mcrt1.o%s libprof1.a%s}%{!p:crt1.o%s}}} \
diff -Naur gcc-4.6.0-old/gcc/config/mips/iris6.h gcc-4.6.0-new/gcc/config/mips/iris6.h
--- gcc-4.6.0-old/gcc/config/mips/iris6.h 2011-03-28 21:06:17.000000000 -0700
+++ gcc-4.6.0-new/gcc/config/mips/iris6.h 2011-03-28 21:08:12.000000000 -0700
@@ -226,27 +226,27 @@
#define STARTFILE_SPEC \
"%{!shared: \
%{mabi=n32: \
- %{mips4:%{pg:/usr/lib32/mips4/gcrt1.o%s} \
- %{!pg:%{p:/usr/lib32/mips4/mcrt1.o%s /usr/lib32/mips4/libprof1.a%s} \
@ -57,10 +57,10 @@ diff -Naur gcc-4.5-20100610-old/gcc/config/mips/iris6.h gcc-4.5-20100610-new/gcc
%{!shared:" \
SUBTARGET_DONT_WARN_UNUSED_SPEC \
" %{pthread:-lpthread} %{p:libprof1.a%s}%{pg:libprof1.a%s} -lc " \
@@ -125,10 +125,10 @@
@@ -262,10 +262,10 @@
#define ENDFILE_SPEC \
"crtend.o%s irix-crtn.o%s \
%{!shared: \
%{mabi=32:crtn.o%s}\
- %{mabi=n32:%{mips4:/usr/lib32/mips4/crtn.o%s}\
- %{!mips4:/usr/lib32/mips3/crtn.o%s}}\
- %{mabi=64:%{mips4:/usr/lib64/mips4/crtn.o%s}\
@ -70,11 +70,11 @@ diff -Naur gcc-4.5-20100610-old/gcc/config/mips/iris6.h gcc-4.5-20100610-new/gcc
+ %{mabi=64:%{mips4:/usr/lib/mips4/crtn.o%s}\
+ %{!mips4:/usr/lib/mips3/crtn.o%s}}}"
#define MIPS_TFMODE_FORMAT mips_extended_format
diff -Naur gcc-4.5-20100610-old/gcc/config/mips/linux64.h gcc-4.5-20100610-new/gcc/config/mips/linux64.h
--- gcc-4.5-20100610-old/gcc/config/mips/linux64.h 2010-06-11 09:40:14.000000000 -0700
+++ gcc-4.5-20100610-new/gcc/config/mips/linux64.h 2010-06-11 09:41:13.000000000 -0700
/* Generic part of the LINK_SPEC. */
#undef LINK_SPEC
diff -Naur gcc-4.6.0-old/gcc/config/mips/linux64.h gcc-4.6.0-new/gcc/config/mips/linux64.h
--- gcc-4.6.0-old/gcc/config/mips/linux64.h 2011-03-28 21:06:17.000000000 -0700
+++ gcc-4.6.0-new/gcc/config/mips/linux64.h 2011-03-28 21:08:52.000000000 -0700
@@ -36,9 +36,9 @@
%{profile:-lc_p} %{!profile:-lc}}"
@ -85,13 +85,13 @@ diff -Naur gcc-4.5-20100610-old/gcc/config/mips/linux64.h gcc-4.5-20100610-new/g
+#define GLIBC_DYNAMIC_LINKER64 "/lib/ld.so.1"
+#define GLIBC_DYNAMIC_LINKERN32 "/lib/ld.so.1"
+#define UCLIBC_DYNAMIC_LINKERN32 "/lib/ld-uClibc.so.0"
#define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32"
#define LINUX_DYNAMIC_LINKERN32 \
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32)
diff -Naur gcc-4.5-20100610-old/gcc/config/rs6000/linux64.h gcc-4.5-20100610-new/gcc/config/rs6000/linux64.h
--- gcc-4.5-20100610-old/gcc/config/rs6000/linux64.h 2010-06-11 09:40:14.000000000 -0700
+++ gcc-4.5-20100610-new/gcc/config/rs6000/linux64.h 2010-06-11 09:41:13.000000000 -0700
@@ -349,7 +349,7 @@
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \
diff -Naur gcc-4.6.0-old/gcc/config/rs6000/linux64.h gcc-4.6.0-new/gcc/config/rs6000/linux64.h
--- gcc-4.6.0-old/gcc/config/rs6000/linux64.h 2011-03-28 21:06:17.000000000 -0700
+++ gcc-4.6.0-new/gcc/config/rs6000/linux64.h 2011-03-28 21:07:35.000000000 -0700
@@ -373,7 +373,7 @@
#define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
@ -99,12 +99,12 @@ diff -Naur gcc-4.5-20100610-old/gcc/config/rs6000/linux64.h gcc-4.5-20100610-new
+#define GLIBC_DYNAMIC_LINKER64 "/lib/ld64.so.1"
#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
#if UCLIBC_DEFAULT
diff -Naur gcc-4.5-20100610-old/gcc/config/sparc/linux64.h gcc-4.5-20100610-new/gcc/config/sparc/linux64.h
--- gcc-4.5-20100610-old/gcc/config/sparc/linux64.h 2010-06-11 09:40:14.000000000 -0700
+++ gcc-4.5-20100610-new/gcc/config/sparc/linux64.h 2010-06-11 09:41:13.000000000 -0700
@@ -110,7 +110,7 @@
/* If ELF is the default format, we should not use /lib/elf. */
#if DEFAULT_LIBC == LIBC_UCLIBC
diff -Naur gcc-4.6.0-old/gcc/config/sparc/linux64.h gcc-4.6.0-new/gcc/config/sparc/linux64.h
--- gcc-4.6.0-old/gcc/config/sparc/linux64.h 2011-03-28 21:06:17.000000000 -0700
+++ gcc-4.6.0-new/gcc/config/sparc/linux64.h 2011-03-28 21:07:35.000000000 -0700
@@ -102,7 +102,7 @@
done. */
#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux.so.2"
@ -112,21 +112,21 @@ diff -Naur gcc-4.5-20100610-old/gcc/config/sparc/linux64.h gcc-4.5-20100610-new/
#ifdef SPARC_BI_ARCH
@@ -130,7 +130,7 @@
%{static:-static}}} \
@@ -121,7 +121,7 @@
%{static:-static}} \
"
-#define LINK_ARCH64_SPEC "-m elf64_sparc -Y P,%R/usr/lib64 %{shared:-shared} \
+#define LINK_ARCH64_SPEC "-m elf64_sparc -Y P,%R/usr/lib %{shared:-shared} \
%{!shared: \
%{!ibcs: \
%{!static: \
@@ -211,7 +211,7 @@
%{!static: \
%{rdynamic:-export-dynamic} \
@@ -193,7 +193,7 @@
#else /* !SPARC_BI_ARCH */
#undef LINK_SPEC
-#define LINK_SPEC "-m elf64_sparc -Y P,%R/usr/lib64 %{shared:-shared} \
+#define LINK_SPEC "-m elf64_sparc -Y P,%R/usr/lib %{shared:-shared} \
%{!shared: \
%{!ibcs: \
%{!static: \
%{!static: \
%{rdynamic:-export-dynamic} \

View File

@ -1,6 +1,6 @@
diff -Naur gcc-4.5-20100610-old/libstdc++-v3/config.h.in gcc-4.5-20100610-new/libstdc++-v3/config.h.in
--- gcc-4.5-20100610-old/libstdc++-v3/config.h.in 2010-06-11 09:40:55.000000000 -0700
+++ gcc-4.5-20100610-new/libstdc++-v3/config.h.in 2010-06-11 09:41:44.000000000 -0700
diff -Naur gcc-4.6.0-old/libstdc++-v3/config.h.in gcc-4.6.0-new/libstdc++-v3/config.h.in
--- gcc-4.6.0-old/libstdc++-v3/config.h.in 2011-03-28 21:07:18.000000000 -0700
+++ gcc-4.6.0-new/libstdc++-v3/config.h.in 2011-03-28 21:10:03.000000000 -0700
@@ -115,7 +115,7 @@
#undef HAVE_FABSL
@ -46,7 +46,7 @@ diff -Naur gcc-4.5-20100610-old/libstdc++-v3/config.h.in gcc-4.5-20100610-new/li
/* Define if strerror_r is available in <string.h>. */
#undef HAVE_STRERROR_R
@@ -356,7 +356,7 @@
@@ -360,7 +360,7 @@
#undef HAVE_SYS_IOCTL_H
/* Define to 1 if you have the <sys/ipc.h> header file. */
@ -55,7 +55,7 @@ diff -Naur gcc-4.5-20100610-old/libstdc++-v3/config.h.in gcc-4.5-20100610-new/li
/* Define to 1 if you have the <sys/isa_defs.h> header file. */
#undef HAVE_SYS_ISA_DEFS_H
@@ -368,16 +368,16 @@
@@ -372,16 +372,16 @@
#undef HAVE_SYS_PARAM_H
/* Define to 1 if you have the <sys/resource.h> header file. */
@ -75,7 +75,7 @@ diff -Naur gcc-4.5-20100610-old/libstdc++-v3/config.h.in gcc-4.5-20100610-new/li
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
@@ -407,7 +407,7 @@
@@ -411,7 +411,7 @@
#undef HAVE_TGMATH_H
/* Define to 1 if the target supports thread-local storage. */
@ -84,7 +84,7 @@ diff -Naur gcc-4.5-20100610-old/libstdc++-v3/config.h.in gcc-4.5-20100610-new/li
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
@@ -620,7 +620,7 @@
@@ -624,7 +624,7 @@
#undef HAVE__TANL
/* Define as const if the declaration of iconv() needs const. */