From 51ef0592f371d5e305150cd4036e8482a478dfdd Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sat, 16 Jul 2011 14:29:38 +0200 Subject: [PATCH 01/21] Revert "gcc: update to gcc-4.6.1" This reverts commit c1fb643d0a05d63cf25aa039d310db4e4ae16540. --- packages/toolchain/lang/gcc/meta | 2 +- .../gcc/patches/gcc-4.5.3-bfd_and_gold.patch | 666 ++++++++++++++++++ ...4.5.3-disable_multilib_i386_linux64.patch} | 6 +- ...r.patch => gcc-4.5.3-dynamic_linker.patch} | 72 +- ...ix_undefined_references_with_lto-0.1.patch | 126 ++++ ...ch => gcc-4.5.3-libstdc++-v3_config.patch} | 14 +- 6 files changed, 839 insertions(+), 47 deletions(-) create mode 100644 packages/toolchain/lang/gcc/patches/gcc-4.5.3-bfd_and_gold.patch rename packages/toolchain/lang/gcc/patches/{gcc-4.6.1-disable_multilib_i386_linux64.patch => gcc-4.5.3-disable_multilib_i386_linux64.patch} (76%) rename packages/toolchain/lang/gcc/patches/{gcc-4.6.1-dynamic_linker.patch => gcc-4.5.3-dynamic_linker.patch} (68%) create mode 100644 packages/toolchain/lang/gcc/patches/gcc-4.5.3-fix_undefined_references_with_lto-0.1.patch rename packages/toolchain/lang/gcc/patches/{gcc-4.6.1-libstdc++-v3_config.patch => gcc-4.5.3-libstdc++-v3_config.patch} (86%) diff --git a/packages/toolchain/lang/gcc/meta b/packages/toolchain/lang/gcc/meta index cfb17f9d6b..5fef08c778 100644 --- a/packages/toolchain/lang/gcc/meta +++ b/packages/toolchain/lang/gcc/meta @@ -19,7 +19,7 @@ ################################################################################ PKG_NAME="gcc" -PKG_VERSION="4.6.1" +PKG_VERSION="4.5.3" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/toolchain/lang/gcc/patches/gcc-4.5.3-bfd_and_gold.patch b/packages/toolchain/lang/gcc/patches/gcc-4.5.3-bfd_and_gold.patch new file mode 100644 index 0000000000..a3b33273d3 --- /dev/null +++ b/packages/toolchain/lang/gcc/patches/gcc-4.5.3-bfd_and_gold.patch @@ -0,0 +1,666 @@ +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 @@ + 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-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 @@ + 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-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 @@ + 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, +@@ -1965,6 +1976,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-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 @@ + -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} + +@@ -7416,6 +7416,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-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 +@@ -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-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 \ ++ "%{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-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. */ + 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: diff --git a/packages/toolchain/lang/gcc/patches/gcc-4.6.1-disable_multilib_i386_linux64.patch b/packages/toolchain/lang/gcc/patches/gcc-4.5.3-disable_multilib_i386_linux64.patch similarity index 76% rename from packages/toolchain/lang/gcc/patches/gcc-4.6.1-disable_multilib_i386_linux64.patch rename to packages/toolchain/lang/gcc/patches/gcc-4.5.3-disable_multilib_i386_linux64.patch index b293a951be..a616fa3ec2 100644 --- a/packages/toolchain/lang/gcc/patches/gcc-4.6.1-disable_multilib_i386_linux64.patch +++ b/packages/toolchain/lang/gcc/patches/gcc-4.5.3-disable_multilib_i386_linux64.patch @@ -1,6 +1,6 @@ -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 +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 @@ -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. diff --git a/packages/toolchain/lang/gcc/patches/gcc-4.6.1-dynamic_linker.patch b/packages/toolchain/lang/gcc/patches/gcc-4.5.3-dynamic_linker.patch similarity index 68% rename from packages/toolchain/lang/gcc/patches/gcc-4.6.1-dynamic_linker.patch rename to packages/toolchain/lang/gcc/patches/gcc-4.5.3-dynamic_linker.patch index bf0dc1e4e3..05925a915a 100644 --- a/packages/toolchain/lang/gcc/patches/gcc-4.6.1-dynamic_linker.patch +++ b/packages/toolchain/lang/gcc/patches/gcc-4.5.3-dynamic_linker.patch @@ -1,7 +1,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 @@ +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 @@ done. */ #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2" @@ -10,12 +10,12 @@ diff -Naur gcc-4.6.0-old/gcc/config/i386/linux64.h gcc-4.6.0-new/gcc/config/i386 #if TARGET_64BIT_DEFAULT #define SPEC_32 "m32" -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: \ +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}}} \ %{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.6.0-old/gcc/config/mips/iris6.h gcc-4.6.0-new/gcc/config/mips/i %{!shared:" \ SUBTARGET_DONT_WARN_UNUSED_SPEC \ " %{pthread:-lpthread} %{p:libprof1.a%s}%{pg:libprof1.a%s} -lc " \ -@@ -262,10 +262,10 @@ - #define ENDFILE_SPEC \ +@@ -125,10 +125,10 @@ "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.6.0-old/gcc/config/mips/iris6.h gcc-4.6.0-new/gcc/config/mips/i + %{mabi=64:%{mips4:/usr/lib/mips4/crtn.o%s}\ + %{!mips4:/usr/lib/mips3/crtn.o%s}}}" - /* 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 + #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 @@ -36,9 +36,9 @@ %{profile:-lc_p} %{!profile:-lc}}" @@ -85,13 +85,13 @@ diff -Naur gcc-4.6.0-old/gcc/config/mips/linux64.h gcc-4.6.0-new/gcc/config/mips +#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.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 @@ + 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 @@ #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)" #define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1" @@ -99,12 +99,12 @@ diff -Naur gcc-4.6.0-old/gcc/config/rs6000/linux64.h gcc-4.6.0-new/gcc/config/rs +#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 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. */ + #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. */ #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.6.0-old/gcc/config/sparc/linux64.h gcc-4.6.0-new/gcc/config/spa #ifdef SPARC_BI_ARCH -@@ -121,7 +121,7 @@ - %{static:-static}} \ +@@ -130,7 +130,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: \ - %{!static: \ - %{rdynamic:-export-dynamic} \ -@@ -193,7 +193,7 @@ + %{!ibcs: \ + %{!static: \ +@@ -211,7 +211,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: \ - %{!static: \ - %{rdynamic:-export-dynamic} \ + %{!ibcs: \ + %{!static: \ diff --git a/packages/toolchain/lang/gcc/patches/gcc-4.5.3-fix_undefined_references_with_lto-0.1.patch b/packages/toolchain/lang/gcc/patches/gcc-4.5.3-fix_undefined_references_with_lto-0.1.patch new file mode 100644 index 0000000000..62f5b8ae52 --- /dev/null +++ b/packages/toolchain/lang/gcc/patches/gcc-4.5.3-fix_undefined_references_with_lto-0.1.patch @@ -0,0 +1,126 @@ +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", <o_wrapper_spec), + INIT_STATIC_SPEC ("lto_gcc", <o_gcc_spec), +- INIT_STATIC_SPEC ("lto_libgcc", <o_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; ++} diff --git a/packages/toolchain/lang/gcc/patches/gcc-4.6.1-libstdc++-v3_config.patch b/packages/toolchain/lang/gcc/patches/gcc-4.5.3-libstdc++-v3_config.patch similarity index 86% rename from packages/toolchain/lang/gcc/patches/gcc-4.6.1-libstdc++-v3_config.patch rename to packages/toolchain/lang/gcc/patches/gcc-4.5.3-libstdc++-v3_config.patch index e35dd2cc0b..b7c6a701e1 100644 --- a/packages/toolchain/lang/gcc/patches/gcc-4.6.1-libstdc++-v3_config.patch +++ b/packages/toolchain/lang/gcc/patches/gcc-4.5.3-libstdc++-v3_config.patch @@ -1,6 +1,6 @@ -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 +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 @@ -115,7 +115,7 @@ #undef HAVE_FABSL @@ -46,7 +46,7 @@ diff -Naur gcc-4.6.0-old/libstdc++-v3/config.h.in gcc-4.6.0-new/libstdc++-v3/con /* Define if strerror_r is available in . */ #undef HAVE_STRERROR_R -@@ -360,7 +360,7 @@ +@@ -356,7 +356,7 @@ #undef HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file. */ @@ -55,7 +55,7 @@ diff -Naur gcc-4.6.0-old/libstdc++-v3/config.h.in gcc-4.6.0-new/libstdc++-v3/con /* Define to 1 if you have the header file. */ #undef HAVE_SYS_ISA_DEFS_H -@@ -372,16 +372,16 @@ +@@ -368,16 +368,16 @@ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ @@ -75,7 +75,7 @@ diff -Naur gcc-4.6.0-old/libstdc++-v3/config.h.in gcc-4.6.0-new/libstdc++-v3/con /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H -@@ -411,7 +411,7 @@ +@@ -407,7 +407,7 @@ #undef HAVE_TGMATH_H /* Define to 1 if the target supports thread-local storage. */ @@ -84,7 +84,7 @@ diff -Naur gcc-4.6.0-old/libstdc++-v3/config.h.in gcc-4.6.0-new/libstdc++-v3/con /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H -@@ -624,7 +624,7 @@ +@@ -620,7 +620,7 @@ #undef HAVE__TANL /* Define as const if the declaration of iconv() needs const. */ From f56955ae4a7dd2b52e3182a65bfb51acac4693cd Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sat, 16 Jul 2011 14:30:01 +0200 Subject: [PATCH 02/21] Revert "gcc-core: update for gcc-4.6.1" This reverts commit 0b971b50d31a6d7ff2722153677f9b8514324440. --- packages/toolchain/lang/gcc-core/build | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/toolchain/lang/gcc-core/build b/packages/toolchain/lang/gcc-core/build index 722120eeaa..6ef5ebf8a4 100755 --- a/packages/toolchain/lang/gcc-core/build +++ b/packages/toolchain/lang/gcc-core/build @@ -49,11 +49,9 @@ mkdir -p objdir-$1 && cd objdir-$1 --disable-__cxa_atexit \ --disable-libada \ --disable-libmudflap \ - --enable-gold=yes \ - --enable-ld=default \ + --enable-gold=both/ld \ --enable-plugin \ --enable-lto \ - --disable-libquadmath \ --disable-libssp \ --disable-libgomp \ --disable-shared \ From 9e3c9991acef45398d64e10684230fb582f6ed0e Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sat, 16 Jul 2011 14:30:19 +0200 Subject: [PATCH 03/21] Revert "gcc-final: update for gcc-4.6.1" This reverts commit e60e2cb6d2620bf1aa877561f29ad0e7f1e5fb87. --- packages/toolchain/lang/gcc-final/build | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/toolchain/lang/gcc-final/build b/packages/toolchain/lang/gcc-final/build index 8dc04c038b..883fe3fb0f 100755 --- a/packages/toolchain/lang/gcc-final/build +++ b/packages/toolchain/lang/gcc-final/build @@ -49,11 +49,9 @@ mkdir -p objdir-$1 && cd objdir-$1 --disable-libmudflap \ --disable-libssp \ --disable-multilib \ - --enable-gold=yes \ - --enable-ld=default \ + --enable-gold=both/ld \ --enable-plugin \ --enable-lto \ - --disable-libquadmath \ --enable-tls \ --enable-shared \ --enable-c99 \ From a3c5e63efad7c7ed26d77dcaa3117d43bc78fa16 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sat, 16 Jul 2011 14:32:18 +0200 Subject: [PATCH 04/21] config/optimize: use -ffast-math with -O3 optimization Signed-off-by: Stephan Raue --- config/optimize | 1 + 1 file changed, 1 insertion(+) diff --git a/config/optimize b/config/optimize index 2e1f9376ce..dd390b47aa 100644 --- a/config/optimize +++ b/config/optimize @@ -7,6 +7,7 @@ fi if [ "$OPTIMIZATIONS" = speed ];then GCC_OPTIM="$GCC_OPTIM -O3" GCC_OPTIM="$GCC_OPTIM -fexcess-precision=fast" + GCC_OPTIM="$GCC_OPTIM -ffast-math" LD_OPTIM="-Wl,--as-needed" fi From 11a35e870ec894ae83b267cd5d603b356febafe7 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sat, 16 Jul 2011 14:32:58 +0200 Subject: [PATCH 05/21] Revert "projects/*/options: build with -Ofast optimization per default" This reverts commit 797878f553285deb1c3f36f4eb0453107db97ac5. --- projects/ATV/options | 4 ++-- projects/Fusion/options | 4 ++-- projects/Generic/options | 4 ++-- projects/ION/options | 4 ++-- projects/Intel/options | 4 ++-- projects/Ultra/options | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/projects/ATV/options b/projects/ATV/options index d26254c0d9..ae2d2d3fd1 100644 --- a/projects/ATV/options +++ b/projects/ATV/options @@ -71,8 +71,8 @@ ;; esac -# Build optimizations (size/normal/speed/fast) - OPTIMIZATIONS="fast" +# Build optimizations (size/speed) + OPTIMIZATIONS="speed" # Project CFLAGS PROJECT_CFLAGS="" diff --git a/projects/Fusion/options b/projects/Fusion/options index e4a9e4b17c..a499f8d3af 100644 --- a/projects/Fusion/options +++ b/projects/Fusion/options @@ -71,8 +71,8 @@ ;; esac -# Build optimizations (size/normal/speed/fast) - OPTIMIZATIONS="fast" +# Build optimizations (size/normal/speed) + OPTIMIZATIONS="speed" # Project CFLAGS PROJECT_CFLAGS="-mfpmath=sse -msse2 -mssse3 -ftree-vectorize" diff --git a/projects/Generic/options b/projects/Generic/options index 6ebecb20b0..625745abe8 100644 --- a/projects/Generic/options +++ b/projects/Generic/options @@ -71,8 +71,8 @@ ;; esac -# Build optimizations (size/normal/speed/fast) - OPTIMIZATIONS="fast" +# Build optimizations (size/speed) + OPTIMIZATIONS="speed" # Project CFLAGS PROJECT_CFLAGS="-mmmx -msse -msse2 -mfpmath=sse" diff --git a/projects/ION/options b/projects/ION/options index 964a41068b..8fe9e4d41b 100644 --- a/projects/ION/options +++ b/projects/ION/options @@ -71,8 +71,8 @@ ;; esac -# Build optimizations (size/normal/speed/fast) - OPTIMIZATIONS="fast" +# Build optimizations (size/normal/speed) + OPTIMIZATIONS="speed" # Project CFLAGS PROJECT_CFLAGS="-mfpmath=sse -msse2 -mssse3 -mmovbe -ftree-vectorize" diff --git a/projects/Intel/options b/projects/Intel/options index 00ebf74e8c..808a3e55e0 100644 --- a/projects/Intel/options +++ b/projects/Intel/options @@ -71,8 +71,8 @@ ;; esac -# Build optimizations (size/normal/speed/fast) - OPTIMIZATIONS="fast" +# Build optimizations (size/speed) + OPTIMIZATIONS="speed" # Project CFLAGS PROJECT_CFLAGS="-mfpmath=sse -msse2 -mssse3 -mmovbe -ftree-vectorize" diff --git a/projects/Ultra/options b/projects/Ultra/options index ba9ba740a1..1af99922f9 100644 --- a/projects/Ultra/options +++ b/projects/Ultra/options @@ -71,8 +71,8 @@ ;; esac -# Build optimizations (size/normal/speed/fast) - OPTIMIZATIONS="fast" +# Build optimizations (size/normal/speed) + OPTIMIZATIONS="speed" # Project CFLAGS PROJECT_CFLAGS="-mfpmath=sse -msse2 -mssse3 -mmovbe -ftree-vectorize" From b9267c3b31344dd6516014b646633874d5f775a3 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sat, 16 Jul 2011 14:36:13 +0200 Subject: [PATCH 06/21] Revert "pcre: dont build with LTO support" This reverts commit e9995dcc042d1e3531f134dea27381745145861e. --- packages/devel/pcre/build | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/devel/pcre/build b/packages/devel/pcre/build index acc32b1a5d..29456feb4c 100755 --- a/packages/devel/pcre/build +++ b/packages/devel/pcre/build @@ -22,9 +22,6 @@ . config/options $1 -# fails to build with gcc-4.6.1 - strip_lto - cd $PKG_BUILD mkdir -p m4 && do_autoreconf From a7ab11e00ef6e5adfe7f335d22bb798398ad0446 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sat, 16 Jul 2011 14:37:03 +0200 Subject: [PATCH 07/21] Revert "xbmc: build with GOLD support" This reverts commit eb11adeb7bf6fae3335fe4eff1441e1dab37cdfa. --- packages/mediacenter/xbmc/build | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/mediacenter/xbmc/build b/packages/mediacenter/xbmc/build index eafe23935a..6687d74c8b 100755 --- a/packages/mediacenter/xbmc/build +++ b/packages/mediacenter/xbmc/build @@ -78,6 +78,8 @@ fi # xbmc (ffmpeg) fails to build with LTO optimization strip_lto + strip_gold + strip_linker_plugin # dont use some optimizations because of problems # this fixes problems with faac implementation of ffmpeg From 7b1cef9fe433e463c83e7366bc9089c8774d4038 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sat, 16 Jul 2011 14:37:47 +0200 Subject: [PATCH 08/21] Revert "unrar: build with GOLD support" This reverts commit d18e2607120643a7c6ed042d3676db5b6902b54a. --- packages/compress/unrar/build | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/compress/unrar/build b/packages/compress/unrar/build index 448e3bdd34..ad4abd75fb 100755 --- a/packages/compress/unrar/build +++ b/packages/compress/unrar/build @@ -22,6 +22,9 @@ . config/options $1 +# fails to build with GOLD linker + strip_gold + cd $BUILD/$1 make CC=$TARGET_CC \ RANLIB=$TARGET_RANLIB \ From 04e3e52a089de9f8eead06fc77d40a9ae545ea32 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sat, 16 Jul 2011 14:38:05 +0200 Subject: [PATCH 09/21] Revert "Mesa: build with GOLD support" This reverts commit 8d78aa9b29cf9c0b91a524b2167b8444700909d7. --- packages/graphics/Mesa/build | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/graphics/Mesa/build b/packages/graphics/Mesa/build index bf1325fbee..a897c51231 100755 --- a/packages/graphics/Mesa/build +++ b/packages/graphics/Mesa/build @@ -24,7 +24,10 @@ get_graphicdrivers -strip_lto # Mesa fails to build with LTO optimization +# dont use gold linker because of compiling issues + strip_gold + strip_linker_plugin + strip_lto # Mesa fails to build with LTO optimization if [ "$LLVM_SUPPORT" = "yes" ]; then export LLVM_CONFIG="$SYSROOT_PREFIX/usr/bin/llvm-config" From 45149e33152f0888f3c763cb56f16ac4ccb42aae Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sat, 16 Jul 2011 14:39:17 +0200 Subject: [PATCH 10/21] Revert "parted: build with GOLD support" This reverts commit bf769526484a762a81381c7ab668571bf1aa04b6. Conflicts: packages/sysutils/parted/build --- packages/sysutils/parted/build | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/sysutils/parted/build b/packages/sysutils/parted/build index d79ad29900..5e4caa08ac 100755 --- a/packages/sysutils/parted/build +++ b/packages/sysutils/parted/build @@ -22,6 +22,9 @@ . config/options $1 +# parted fails to build with GOLD linker + strip_gold + cd $PKG_BUILD ./configure --host=$TARGET_NAME \ --build=$HOST_NAME \ From 941a3c13335ebbb0bca43a1f4d80b253fffb51a6 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sat, 16 Jul 2011 14:41:18 +0200 Subject: [PATCH 11/21] Revert "libplist: build with GOLD support" This reverts commit 427f5461120df12e8bec513ee2c895e530a270ef. Conflicts: packages/devel/libplist/build --- packages/devel/libplist/build | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/devel/libplist/build b/packages/devel/libplist/build index f8c4cd7475..18e4e159f0 100755 --- a/packages/devel/libplist/build +++ b/packages/devel/libplist/build @@ -22,6 +22,9 @@ . config/options $1 +# libplist fails to build with GOLD linker + strip_gold + cd $PKG_BUILD mkdir -p build && cd build From 54c890cfda9004d3b423c6801b273672690c28ed Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sat, 16 Jul 2011 14:41:56 +0200 Subject: [PATCH 12/21] Revert "gcc: add BFD and GOLD support patch" This reverts commit c845a458a42a734c11823cade9d0462fadf5297c. --- .../gcc/patches/gcc-4.6.1-bfd_and_gold.patch | 486 ------------------ 1 file changed, 486 deletions(-) delete mode 100644 packages/toolchain/lang/gcc/patches/gcc-4.6.1-bfd_and_gold.patch diff --git a/packages/toolchain/lang/gcc/patches/gcc-4.6.1-bfd_and_gold.patch b/packages/toolchain/lang/gcc/patches/gcc-4.6.1-bfd_and_gold.patch deleted file mode 100644 index 61f397ae40..0000000000 --- a/packages/toolchain/lang/gcc/patches/gcc-4.6.1-bfd_and_gold.patch +++ /dev/null @@ -1,486 +0,0 @@ -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) - { -- 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 -@@ -1095,6 +1097,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 = -@@ -1110,15 +1116,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; -@@ -1132,7 +1140,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 -@@ -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) - 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; - 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 */ -@@ -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). */ -- 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.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 - -+fuse-ld= -+Common Joined Undocumented -+ - fuse-linker-plugin - Common Undocumented - -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]) - -+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, -@@ -1966,6 +1977,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.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 -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 -Ofast} - -@@ -7743,6 +7743,16 @@ - - 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} 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} and @option{--enable-ld}. -+ - @item -fcprop-registers - @opindex fcprop-registers - After register allocation and post-register allocation instruction splitting, -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, 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 -@@ -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"` - id=$invoked -@@ -36,15 +38,44 @@ - dir=gas - ;; - collect-ld) -- # when using a linker plugin, gcc will always pass '-plugin' as the -- # 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 -- dir=ld -+ # 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 - id=ld - ;; - nm) -@@ -61,29 +92,58 @@ - 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*. -- eval LT_RCU="\${LT_RCU_$id}" -- test x"$LT_RCU" = x"1" && exec $scriptdir/../prev-$dir/$prog ${1+"$@"} -- -- eval LT_RCU_$id=1 -- export LT_RCU_$id -- $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*. -+ eval LT_RCU="\${LT_RCU_$id}" -+ if test x"$LT_RCU" = x"1"; then -+ original=$scriptdir/../prev-$dir/$prog -+ else -+ eval LT_RCU_$id=1 -+ export LT_RCU_$id -+ 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.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=*:%max_errors = value; - 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: From c13fdd4b05a633065474fb5a7f7760b22062c876 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sat, 16 Jul 2011 14:42:20 +0200 Subject: [PATCH 13/21] Revert "alsa-lib: dont build with LTO support" This reverts commit 9b0b2ed67222195a12a034aec174935f145945ba. --- packages/audio/alsa-lib/build | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/audio/alsa-lib/build b/packages/audio/alsa-lib/build index c3e04f6f14..da3f8e495a 100755 --- a/packages/audio/alsa-lib/build +++ b/packages/audio/alsa-lib/build @@ -22,9 +22,6 @@ . config/options $1 -# fails to build with gcc-4.6.1 - strip_lto - CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=32 -fPIC -DPIC" cd $PKG_BUILD From 6f17fa21914c53bf7d272d68042037bce84b71c1 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sat, 16 Jul 2011 14:43:31 +0200 Subject: [PATCH 14/21] Revert "busybox: dont build with LTO support" This reverts commit 1280a5483b89010a8b2a5e1c82c5197bd419bcd5. Conflicts: packages/sysutils/busybox/build --- packages/sysutils/busybox/build | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/packages/sysutils/busybox/build b/packages/sysutils/busybox/build index 83484b0ab0..79dc1e30ae 100755 --- a/packages/sysutils/busybox/build +++ b/packages/sysutils/busybox/build @@ -28,16 +28,6 @@ else BUSYBOX_CFG_FILE=$ROOT/$PKG_DIR/config/$1.conf fi -# fails to build with gcc-4.6.1 - strip_lto - -# fails to build with gcc-4.6.1 (ggc bug #49716 - CFLAGS=`echo $CFLAGS | sed -e "s|-ftree-loop-distribution||"` - CFLAGS=`echo $CFLAGS | sed -e "s|-floop-interchange||"` - CFLAGS=`echo $CFLAGS | sed -e "s|-floop-strip-mine||"` - CFLAGS=`echo $CFLAGS | sed -e "s|-floop-block||"` - CFLAGS=`echo $CFLAGS | sed -e "s|-fgraphite-identity||"` - # optimize for size CFLAGS=`echo $CFLAGS | sed -e "s|-Ofast|-Os|"` CFLAGS=`echo $CFLAGS | sed -e "s|-O.|-Os|"` From 3258c11ec614d5062c82d47a00454a0cc65d9f60 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sat, 16 Jul 2011 14:45:20 +0200 Subject: [PATCH 15/21] busybox-initramfs: dont strip gold/lto and loop based cflags Signed-off-by: Stephan Raue --- packages/initramfs/sysutils/busybox-initramfs/build | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/packages/initramfs/sysutils/busybox-initramfs/build b/packages/initramfs/sysutils/busybox-initramfs/build index 27f3fa4312..3de593bdd7 100755 --- a/packages/initramfs/sysutils/busybox-initramfs/build +++ b/packages/initramfs/sysutils/busybox-initramfs/build @@ -30,16 +30,6 @@ else BUSYBOX_CFG_FILE=$ROOT/$PKG_DIR/config/$1.conf fi -# fails to build with gcc-4.6.1 - strip_lto - -# fails to build with gcc-4.6.1 (ggc bug #49716 - CFLAGS=`echo $CFLAGS | sed -e "s|-ftree-loop-distribution||"` - CFLAGS=`echo $CFLAGS | sed -e "s|-floop-interchange||"` - CFLAGS=`echo $CFLAGS | sed -e "s|-floop-strip-mine||"` - CFLAGS=`echo $CFLAGS | sed -e "s|-floop-block||"` - CFLAGS=`echo $CFLAGS | sed -e "s|-fgraphite-identity||"` - # optimize for size CFLAGS=`echo $CFLAGS | sed -e "s|-Ofast|-Os|"` CFLAGS=`echo $CFLAGS | sed -e "s|-O.|-Os|"` From 13c5e95035659ab294dceeb8d475ecc28d990a50 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sat, 16 Jul 2011 16:13:18 +0200 Subject: [PATCH 16/21] Revert "config/functions: simplyfing strip_gold function" This reverts commit f80bc4003de37b6a767e3d0ffea07927c4ec73cf. --- config/functions | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/config/functions b/config/functions index 32c0c9d5b2..4ab3eb1e6a 100644 --- a/config/functions +++ b/config/functions @@ -145,14 +145,12 @@ strip_lto() { LDFLAGS=`echo $LDFLAGS | sed -e "s|-flto||"` } +strip_gold() { + # strip out usage from GOLD linker + LDFLAGS=`echo $LDFLAGS | sed -e "s|-fuse-ld=gold||" -e "s|-fuse-linker-plugin||"` +} + strip_linker_plugin() { # strip out usage from linker plugin LDFLAGS=`echo $LDFLAGS | sed -e "s|-fuse-linker-plugin||"` } - -strip_gold() { - # strip out usage from GOLD linker - strip_linker_plugin - LDFLAGS=`echo $LDFLAGS | sed -e "s|-fuse-ld=gold||"` -} - From 50145e1182c08fc9b20ee2992209289b7fc3a577 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sat, 16 Jul 2011 16:19:00 +0200 Subject: [PATCH 17/21] Revert "Revert "config/functions: simplyfing strip_gold function"" This reverts commit 13c5e95035659ab294dceeb8d475ecc28d990a50. --- config/functions | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/config/functions b/config/functions index 4ab3eb1e6a..32c0c9d5b2 100644 --- a/config/functions +++ b/config/functions @@ -145,12 +145,14 @@ strip_lto() { LDFLAGS=`echo $LDFLAGS | sed -e "s|-flto||"` } -strip_gold() { - # strip out usage from GOLD linker - LDFLAGS=`echo $LDFLAGS | sed -e "s|-fuse-ld=gold||" -e "s|-fuse-linker-plugin||"` -} - strip_linker_plugin() { # strip out usage from linker plugin LDFLAGS=`echo $LDFLAGS | sed -e "s|-fuse-linker-plugin||"` } + +strip_gold() { + # strip out usage from GOLD linker + strip_linker_plugin + LDFLAGS=`echo $LDFLAGS | sed -e "s|-fuse-ld=gold||"` +} + From e70a4ecd6eb5647179bd2db5bac1707e7648b88b Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sat, 16 Jul 2011 22:20:58 +0200 Subject: [PATCH 18/21] projects/*/options: fix optimizations, thanks to tom_say Signed-off-by: Stephan Raue --- projects/Fusion/options | 2 +- projects/ION/options | 2 +- projects/Intel/options | 2 +- projects/Ultra/options | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/projects/Fusion/options b/projects/Fusion/options index a499f8d3af..1dda82ad16 100644 --- a/projects/Fusion/options +++ b/projects/Fusion/options @@ -75,7 +75,7 @@ OPTIMIZATIONS="speed" # Project CFLAGS - PROJECT_CFLAGS="-mfpmath=sse -msse2 -mssse3 -ftree-vectorize" + PROJECT_CFLAGS="-mfpmath=sse -msse2 -mssse3" # LTO (Link Time Optimazion) support LTO_SUPPORT="no" diff --git a/projects/ION/options b/projects/ION/options index 8fe9e4d41b..9661063dc7 100644 --- a/projects/ION/options +++ b/projects/ION/options @@ -75,7 +75,7 @@ OPTIMIZATIONS="speed" # Project CFLAGS - PROJECT_CFLAGS="-mfpmath=sse -msse2 -mssse3 -mmovbe -ftree-vectorize" + PROJECT_CFLAGS="-mfpmath=sse -msse2 -mssse3 -mmovbe" # LTO (Link Time Optimazion) support LTO_SUPPORT="no" diff --git a/projects/Intel/options b/projects/Intel/options index 808a3e55e0..7e49c43972 100644 --- a/projects/Intel/options +++ b/projects/Intel/options @@ -75,7 +75,7 @@ OPTIMIZATIONS="speed" # Project CFLAGS - PROJECT_CFLAGS="-mfpmath=sse -msse2 -mssse3 -mmovbe -ftree-vectorize" + PROJECT_CFLAGS="-mfpmath=sse -msse2 -mssse3" # LTO (Link Time Optimazion) support LTO_SUPPORT="no" diff --git a/projects/Ultra/options b/projects/Ultra/options index 1af99922f9..306b2dd3c1 100644 --- a/projects/Ultra/options +++ b/projects/Ultra/options @@ -75,10 +75,10 @@ OPTIMIZATIONS="speed" # Project CFLAGS - PROJECT_CFLAGS="-mfpmath=sse -msse2 -mssse3 -mmovbe -ftree-vectorize" + PROJECT_CFLAGS="-mfpmath=sse -msse2 -mssse3 -mmovbe" # LTO (Link Time Optimazion) support - LTO_SUPPORT="no" + LTO_SUPPORT="yes" # GOLD (Google Linker) support GOLD_SUPPORT="yes" From 733fd08856d67b2efb545a35c6e38df89af50c69 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sat, 16 Jul 2011 22:22:30 +0200 Subject: [PATCH 19/21] eglibc: fix *flags filter Signed-off-by: Stephan Raue --- packages/toolchain/devel/eglibc/build | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/toolchain/devel/eglibc/build b/packages/toolchain/devel/eglibc/build index a9010cdada..16736697bf 100755 --- a/packages/toolchain/devel/eglibc/build +++ b/packages/toolchain/devel/eglibc/build @@ -26,13 +26,13 @@ strip_lto # Fails to compile with GCC's link time optimization. strip_gold # Fails to compile using the gold linker. # Filter out some problematic *FLAGS - CFLAGS=`echo $CFLAGS | sed -e "s|-ffast-math||"` - CFLAGS=`echo $CFLAGS | sed -e "s|-Ofast|-O2|"` - CFLAGS=`echo $CFLAGS | sed -e "s|-O.|-O2|"` + CFLAGS=`echo $CFLAGS | sed -e "s|-ffast-math||g"` + CFLAGS=`echo $CFLAGS | sed -e "s|-Ofast|-O2|g"` + CFLAGS=`echo $CFLAGS | sed -e "s|-O.|-O2|g"` - LDFLAGS=`echo $LDFLAGS | sed -e "s|-ffast-math||"` - LDFLAGS=`echo $LDFLAGS | sed -e "s|-Ofast|-O2|"` - LDFLAGS=`echo $LDFLAGS | sed -e "s|-O.|-O2|"` + LDFLAGS=`echo $LDFLAGS | sed -e "s|-ffast-math||g"` + LDFLAGS=`echo $LDFLAGS | sed -e "s|-Ofast|-O2|g"` + LDFLAGS=`echo $LDFLAGS | sed -e "s|-O.|-O2|g"` # set some CFLAGS we need CFLAGS="$CFLAGS -g -fno-stack-protector" From b5f3d04917c27a6d6997e2ef42f46630f235a3eb Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sat, 16 Jul 2011 22:23:13 +0200 Subject: [PATCH 20/21] config/functions: fix *flags filter Signed-off-by: Stephan Raue --- config/functions | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config/functions b/config/functions index 32c0c9d5b2..c7bb854ba8 100644 --- a/config/functions +++ b/config/functions @@ -140,19 +140,19 @@ do_autoreconf() { strip_lto() { # strip out LTO optimization from *FLAGS - CFLAGS=`echo $CFLAGS | sed -e "s|-flto||"` - CXXFLAGS=`echo $CXXFLAGS | sed -e "s|-flto||"` - LDFLAGS=`echo $LDFLAGS | sed -e "s|-flto||"` + CFLAGS=`echo $CFLAGS | sed -e "s|-flto||g"` + CXXFLAGS=`echo $CXXFLAGS | sed -e "s|-flto||g"` + LDFLAGS=`echo $LDFLAGS | sed -e "s|-flto||g"` } strip_linker_plugin() { # strip out usage from linker plugin - LDFLAGS=`echo $LDFLAGS | sed -e "s|-fuse-linker-plugin||"` + LDFLAGS=`echo $LDFLAGS | sed -e "s|-fuse-linker-plugin||g"` } strip_gold() { # strip out usage from GOLD linker strip_linker_plugin - LDFLAGS=`echo $LDFLAGS | sed -e "s|-fuse-ld=gold||"` + LDFLAGS=`echo $LDFLAGS | sed -e "s|-fuse-ld=gold||g"` } From 8d83bdc481c876c0426babdb81e6c2f52df64132 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sat, 16 Jul 2011 22:24:07 +0200 Subject: [PATCH 21/21] config/optimize: simplyfing Signed-off-by: Stephan Raue --- config/optimize | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/config/optimize b/config/optimize index dd390b47aa..ff78ec361e 100644 --- a/config/optimize +++ b/config/optimize @@ -32,13 +32,15 @@ if [ "$GRAPHITE_SUPPORT" = yes ];then GCC_OPTIM="$GCC_OPTIM -fgraphite-identity" fi -if [ "$LTO_SUPPORT" = yes ];then - GCC_OPTIM="$GCC_OPTIM -flto" +if [ "$LTO_SUPPORT" = yes -o "$GOLD_SUPPORT" = yes ];then LD_OPTIM="$LD_OPTIM -fuse-linker-plugin" fi +if [ "$LTO_SUPPORT" = yes ];then + GCC_OPTIM="$GCC_OPTIM -flto" +fi + if [ "$GOLD_SUPPORT" = yes ];then - LD_OPTIM="$LD_OPTIM -fuse-linker-plugin" LD_OPTIM="$LD_OPTIM -fuse-ld=gold" fi