BDWGC="bdwgc-7_2alpha5-20110107"
BISON="bison-2.7.1"
BIND="bind-9.9.1-P2"
-BINUTILS="binutils-2.23.2"
+BINUTILS="binutils-2.24"
BRIDGE_UTILS="bridge-utils-1.5"
BZIP2="bzip2-1.0.6"
PBZIP2="pbzip2-1.1.6"
--- /dev/null
+Submitted By: Miklos Karacsony <mkaracsony81 at gmail dot com>
+Date: 2014-05-01
+Initial Package Version: 2.24
+Upstream Status: Applied
+Origin: Upstream
+Description: Load gcc LTO plugin by default
+
+diff --git a/binutils/ar.c b/binutils/ar.c
+index a11ed15c86bc..f0feaef5b233 100644
+--- a/binutils/ar.c
++++ b/binutils/ar.c
+@@ -138,7 +138,11 @@ static int show_version = 0;
+
+ static int show_help = 0;
+
++#if BFD_SUPPORTS_PLUGINS
++static const char *plugin_target = "plugin";
++#else
+ static const char *plugin_target = NULL;
++#endif
+
+ static const char *target = NULL;
+
+@@ -571,7 +575,6 @@ decode_options (int argc, char **argv)
+ break;
+ case OPTION_PLUGIN:
+ #if BFD_SUPPORTS_PLUGINS
+- plugin_target = "plugin";
+ bfd_plugin_set_plugin (optarg);
+ #else
+ fprintf (stderr, _("sorry - this program has been built without plugin support\n"));
+@@ -632,7 +635,6 @@ ranlib_main (int argc, char **argv)
+ /* PR binutils/13493: Support plugins. */
+ case OPTION_PLUGIN:
+ #if BFD_SUPPORTS_PLUGINS
+- plugin_target = "plugin";
+ bfd_plugin_set_plugin (optarg);
+ #else
+ fprintf (stderr, _("sorry - this program has been built without plugin support\n"));
+diff --git a/binutils/nm.c b/binutils/nm.c
+index 156194f21de7..876bbed7a407 100644
+--- a/binutils/nm.c
++++ b/binutils/nm.c
+@@ -177,7 +177,11 @@ static char other_format[] = "%02x";
+ static char desc_format[] = "%04x";
+
+ static char *target = NULL;
+-static char *plugin_target = NULL;
++#if BFD_SUPPORTS_PLUGINS
++static const char *plugin_target = "plugin";
++#else
++static const char *plugin_target = NULL;
++#endif
+
+ /* Used to cache the line numbers for a BFD. */
+ static bfd *lineno_cache_bfd;
+@@ -1648,7 +1652,6 @@ main (int argc, char **argv)
+
+ case OPTION_PLUGIN: /* --plugin */
+ #if BFD_SUPPORTS_PLUGINS
+- plugin_target = "plugin";
+ bfd_plugin_set_plugin (optarg);
+ #else
+ fatal (_("sorry - this program has been built without plugin support\n"));
--- /dev/null
+Submitted By: Bruce Dubbs <bdubbs@linuxfromscratch.org>
+Date: 2014-07-19
+Initial Package Version: 2.24
+Upstream Status: Unknown
+Origin: Arch Linux
+Description: Fix binutils LTO tests
+
+index c5249f0..69946de 100644
+--- a/ld/testsuite/ld-plugin/lto.exp
++++ b/ld/testsuite/ld-plugin/lto.exp
+@@ -57,7 +57,7 @@ set lto_link_tests {
+ "" "-O2"
+ {lto-3c.c} {} "libdummy.a"}
+ {"Build liblto-3.a"
+- "" "-flto"
++ "" "-flto -ffat-lto-objects"
+ {lto-3b.c} {} "liblto-3.a"}
+ {"Build libdummy.a 5a"
+ "" "-flto"
+@@ -111,7 +111,7 @@ set lto_link_tests {
+ "" ""
+ {pr12758a.s} {} "libdummy.a"}
+ {"Build libpr12758.a"
+- "" "-flto -O2"
++ "" "-flto -O2 -ffat-lto-objects"
+ {pr12758b.c} {} "libpr12758.a"}
+ {"PR ld/12758"
+ "-O2 -Wl,-e,foo -nostdlib -flto -fuse-linker-plugin tmpdir/pr12758a.o -Wl,--start-group tmpdir/libpr12758.a -Wl,--end-group" ""
+@@ -120,13 +120,13 @@ set lto_link_tests {
+ "" ""
+ {pr12760a.c} {} "libdummy.a"}
+ {"Build libpr12760.a"
+- "" "-flto -O2"
++ "" "-flto -O2 -ffat-lto-objects"
+ {pr12760b.c} {} "libpr12760.a"}
+ {"PR ld/12760"
+ "-O2 -Wl,-e,foo -nostdlib -flto -fuse-linker-plugin tmpdir/pr12760a.o -Wl,--start-group tmpdir/libpr12760.a -Wl,--end-group" ""
+ {dummy.c} {} "pr12760.exe" "c" "warning: Bad bar"}
+ {"Build libpr13183.a"
+- "-T" "-flto -O2"
++ "-T" "-flto -O2 -ffat-lto-objects"
+ {pr13183a.c} {} "libpr13183.a"}
+ {"Build libdummy.a PR ld/13183"
+ "" "-flto -O2"
+diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
+index 8df42ae..175449a 100644
+--- a/ld/testsuite/lib/ld-lib.exp
++++ b/ld/testsuite/lib/ld-lib.exp
+@@ -1643,7 +1643,7 @@ proc check_lto_available { } {
+ set f [open $src "w"]
+ puts $f ""
+ close $f
+- set status [remote_exec host $CC "-shared -B[pwd]/tmpdir/ld/ -flto -fuse-linker-plugin $src -o $output"]
++ set status [remote_exec host $CC "-shared -B[pwd]/tmpdir/ld/ -flto -ffat-lto-objects -fuse-linker-plugin $src -o $output"]
+ if { [lindex $status 0] == 0 } {
+ set lto_available_saved 1
+ } else {
+diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
+index b14f13c..765d85f 100644
+--- a/ld/testsuite/ld-plugin/lto.exp
++++ b/ld/testsuite/ld-plugin/lto.exp
+@@ -324,7 +324,20 @@ if { [is_elf_format] && [check_lto_shared_available] } {
+
+ set testname "Build liblto-11.a"
+ remote_file host delete "tmpdir/liblto-11.a"
+-set catch_output [run_host_cmd "$ar" "rc tmpdir/liblto-11.a tmpdir/lto-11a.o tmpdir/lto-11b.o tmpdir/lto-11c.o"]
++set plugin_names {
++ liblto_plugin.so
++ liblto_plugin-0.dll
++ cyglto_plugin-0.dll
++}
++set plug_opt ""
++foreach plug $plugin_names {
++ set plug_so [run_host_cmd $CC "--print-prog-name $plug"]
++ if { $plug_so ne $plug } then {
++ set plug_opt "--plugin $plug_so"
++ break
++ }
++}
++set catch_output [run_host_cmd "$ar" "rc $plug_opt tmpdir/liblto-11.a tmpdir/lto-11a.o tmpdir/lto-11b.o tmpdir/lto-11c.o"]
+ if {![string match "" $catch_output]} {
+ unresolved $testname
+ restore_notify
+
+
export AR=ar
export AS=as
+ # --with-lib-path:
+ # Set to dummy (non-existent) directory to prevent having
+ # host directories list.
CONFIGURE_OPTS+=" \
--host=${CLFS_HOST} \
--target=${CLFS_TARGET} \
--with-sysroot=${CLFS} \
- --with-lib-path=/tools/lib \
+ --with-lib-path=${CLFS}/dummy-directory/ \
--disable-nls \
--enable-shared \
--disable-multilib"
unset AS
${HVMAKE} configure-host
}
-
-hvbuild_post()
-{
- cp -v ../${PACKAGE}/include/libiberty.h /tools/include
-}
--- /dev/null
+../../../stage0/patches/common/binutils-2.24-load_gcc_lto_plugin_by_default-1.patch
\ No newline at end of file
--- /dev/null
+../../../stage0/patches/common/binutils-2.24-lto_testsuite-1.patch
\ No newline at end of file
case "${HVL_TARGET}" in
"x86_64")
- # Libiberty uses gcc -print-multi-os-directory to determine where to
- # install libiberty.a. Because our temporary GCC is still
- # multilib-aware, the command returns ../lib64 which causes the archive
- # to be installed into /usr/lib64. The following sed will prevent this:
- sed -i 's%\(^MULTIOSDIR = \).*%\1 ../lib%' \
- ${LFS_TMP}/${PACKAGE}/libiberty/Makefile.in
-
# This adds 64 bit support to Binutils.
CONFIGURE_OPTS+=" --enable-64-bit-bfd"
;;
make tooldir=/usr
make tooldir=/usr install
}
-
-hvbuild_post()
-{
- # Install the libiberty header file that is needed by some packages:
- cp -v ../${PACKAGE}/include/libiberty.h /usr/include
-}