- Add binutils-2.24-auto-plugin.diff to make plugin auto-load work

for GCC LTO objects.  [bso#14698]

OBS-URL: https://build.opensuse.org/package/show/devel:gcc/binutils?expand=0&rev=157
This commit is contained in:
Richard Biener 2014-03-21 12:27:13 +00:00 committed by Git OBS Bridge
parent 3a62bf9875
commit dc9e77e566
39 changed files with 235 additions and 0 deletions

View File

@ -0,0 +1,83 @@
From: Markus Trippelsdorf <markus at trippelsdorf dot de>
To: binutils at sourceware dot org
Subject: [PATCH] PR14698: Load gcc's bfd-plugin automatically
Now that gcc has switched to "slim" LTO objects by default, it is
essential that ar, nm and ranlib always use the plugin.
Although gcc provides wrappers for this purpose, they are buggy and
superfluous. Binutils already has the ability to load plugins from the
lib/bfd-plugins directory, but unfortunately this only works if ar, nm
and ranlib are invoked on non-ELF files at the moment (so the LLVM gold
plugin works fine already).
The following patch allows one to place the gcc's liblto_plugin in the
lib/bfd-plugins directory and have it loaded by default (as long as the
--target option isn't used).
Please apply if the patch looks acceptable.
Thanks.
2014-01-20 Markus Trippelsdorf <markus@trippelsdorf.de>
PR binutils/14698
ar.c: Set plugin_target early if plugins are supported.
nm.c: Likewise.
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"));

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Mar 21 12:23:43 UTC 2014 - rguenther@suse.com
- Add binutils-2.24-auto-plugin.diff to make plugin auto-load work
for GCC LTO objects. [bso#14698]
-------------------------------------------------------------------
Fri Feb 21 16:59:02 UTC 2014 - matz@suse.de

View File

@ -97,6 +97,7 @@ Patch14: binutils-build-as-needed.diff
Patch18: gold-depend-on-opcodes.diff
Patch22: binutils-bfd_h.patch
Patch23: pie-m68k.patch
Patch24: binutils-2.24-auto-plugin.diff
Patch90: cross-avr-nesc-as.patch
Patch92: cross-avr-omit_section_dynsym.patch
Patch93: cross-avr-size.patch
@ -168,6 +169,7 @@ echo "make check will return with %{make_check_handling} in case of testsuite fa
%patch18
%patch22
%patch23 -p1
%patch24 -p1
%if "%{TARGET}" == "avr"
cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h
%patch90

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Mar 21 12:23:43 UTC 2014 - rguenther@suse.com
- Add binutils-2.24-auto-plugin.diff to make plugin auto-load work
for GCC LTO objects. [bso#14698]
-------------------------------------------------------------------
Fri Feb 21 16:59:02 UTC 2014 - matz@suse.de

View File

@ -100,6 +100,7 @@ Patch14: binutils-build-as-needed.diff
Patch18: gold-depend-on-opcodes.diff
Patch22: binutils-bfd_h.patch
Patch23: pie-m68k.patch
Patch24: binutils-2.24-auto-plugin.diff
Patch90: cross-avr-nesc-as.patch
Patch92: cross-avr-omit_section_dynsym.patch
Patch93: cross-avr-size.patch
@ -171,6 +172,7 @@ echo "make check will return with %{make_check_handling} in case of testsuite fa
%patch18
%patch22
%patch23 -p1
%patch24 -p1
%if "%{TARGET}" == "avr"
cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h
%patch90

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Mar 21 12:23:43 UTC 2014 - rguenther@suse.com
- Add binutils-2.24-auto-plugin.diff to make plugin auto-load work
for GCC LTO objects. [bso#14698]
-------------------------------------------------------------------
Fri Feb 21 16:59:02 UTC 2014 - matz@suse.de

View File

@ -100,6 +100,7 @@ Patch14: binutils-build-as-needed.diff
Patch18: gold-depend-on-opcodes.diff
Patch22: binutils-bfd_h.patch
Patch23: pie-m68k.patch
Patch24: binutils-2.24-auto-plugin.diff
Patch90: cross-avr-nesc-as.patch
Patch92: cross-avr-omit_section_dynsym.patch
Patch93: cross-avr-size.patch
@ -171,6 +172,7 @@ echo "make check will return with %{make_check_handling} in case of testsuite fa
%patch18
%patch22
%patch23 -p1
%patch24 -p1
%if "%{TARGET}" == "avr"
cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h
%patch90

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Mar 21 12:23:43 UTC 2014 - rguenther@suse.com
- Add binutils-2.24-auto-plugin.diff to make plugin auto-load work
for GCC LTO objects. [bso#14698]
-------------------------------------------------------------------
Fri Feb 21 16:59:02 UTC 2014 - matz@suse.de

View File

@ -100,6 +100,7 @@ Patch14: binutils-build-as-needed.diff
Patch18: gold-depend-on-opcodes.diff
Patch22: binutils-bfd_h.patch
Patch23: pie-m68k.patch
Patch24: binutils-2.24-auto-plugin.diff
Patch90: cross-avr-nesc-as.patch
Patch92: cross-avr-omit_section_dynsym.patch
Patch93: cross-avr-size.patch
@ -171,6 +172,7 @@ echo "make check will return with %{make_check_handling} in case of testsuite fa
%patch18
%patch22
%patch23 -p1
%patch24 -p1
%if "%{TARGET}" == "avr"
cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h
%patch90

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Mar 21 12:23:43 UTC 2014 - rguenther@suse.com
- Add binutils-2.24-auto-plugin.diff to make plugin auto-load work
for GCC LTO objects. [bso#14698]
-------------------------------------------------------------------
Fri Feb 21 16:59:02 UTC 2014 - matz@suse.de

View File

@ -100,6 +100,7 @@ Patch14: binutils-build-as-needed.diff
Patch18: gold-depend-on-opcodes.diff
Patch22: binutils-bfd_h.patch
Patch23: pie-m68k.patch
Patch24: binutils-2.24-auto-plugin.diff
Patch90: cross-avr-nesc-as.patch
Patch92: cross-avr-omit_section_dynsym.patch
Patch93: cross-avr-size.patch
@ -171,6 +172,7 @@ echo "make check will return with %{make_check_handling} in case of testsuite fa
%patch18
%patch22
%patch23 -p1
%patch24 -p1
%if "%{TARGET}" == "avr"
cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h
%patch90

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Mar 21 12:23:43 UTC 2014 - rguenther@suse.com
- Add binutils-2.24-auto-plugin.diff to make plugin auto-load work
for GCC LTO objects. [bso#14698]
-------------------------------------------------------------------
Fri Feb 21 16:59:02 UTC 2014 - matz@suse.de

View File

@ -100,6 +100,7 @@ Patch14: binutils-build-as-needed.diff
Patch18: gold-depend-on-opcodes.diff
Patch22: binutils-bfd_h.patch
Patch23: pie-m68k.patch
Patch24: binutils-2.24-auto-plugin.diff
Patch90: cross-avr-nesc-as.patch
Patch92: cross-avr-omit_section_dynsym.patch
Patch93: cross-avr-size.patch
@ -171,6 +172,7 @@ echo "make check will return with %{make_check_handling} in case of testsuite fa
%patch18
%patch22
%patch23 -p1
%patch24 -p1
%if "%{TARGET}" == "avr"
cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h
%patch90

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Mar 21 12:23:43 UTC 2014 - rguenther@suse.com
- Add binutils-2.24-auto-plugin.diff to make plugin auto-load work
for GCC LTO objects. [bso#14698]
-------------------------------------------------------------------
Fri Feb 21 16:59:02 UTC 2014 - matz@suse.de

View File

@ -100,6 +100,7 @@ Patch14: binutils-build-as-needed.diff
Patch18: gold-depend-on-opcodes.diff
Patch22: binutils-bfd_h.patch
Patch23: pie-m68k.patch
Patch24: binutils-2.24-auto-plugin.diff
Patch90: cross-avr-nesc-as.patch
Patch92: cross-avr-omit_section_dynsym.patch
Patch93: cross-avr-size.patch
@ -171,6 +172,7 @@ echo "make check will return with %{make_check_handling} in case of testsuite fa
%patch18
%patch22
%patch23 -p1
%patch24 -p1
%if "%{TARGET}" == "avr"
cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h
%patch90

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Mar 21 12:23:43 UTC 2014 - rguenther@suse.com
- Add binutils-2.24-auto-plugin.diff to make plugin auto-load work
for GCC LTO objects. [bso#14698]
-------------------------------------------------------------------
Fri Feb 21 16:59:02 UTC 2014 - matz@suse.de

View File

@ -100,6 +100,7 @@ Patch14: binutils-build-as-needed.diff
Patch18: gold-depend-on-opcodes.diff
Patch22: binutils-bfd_h.patch
Patch23: pie-m68k.patch
Patch24: binutils-2.24-auto-plugin.diff
Patch90: cross-avr-nesc-as.patch
Patch92: cross-avr-omit_section_dynsym.patch
Patch93: cross-avr-size.patch
@ -171,6 +172,7 @@ echo "make check will return with %{make_check_handling} in case of testsuite fa
%patch18
%patch22
%patch23 -p1
%patch24 -p1
%if "%{TARGET}" == "avr"
cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h
%patch90

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Mar 21 12:23:43 UTC 2014 - rguenther@suse.com
- Add binutils-2.24-auto-plugin.diff to make plugin auto-load work
for GCC LTO objects. [bso#14698]
-------------------------------------------------------------------
Fri Feb 21 16:59:02 UTC 2014 - matz@suse.de

View File

@ -100,6 +100,7 @@ Patch14: binutils-build-as-needed.diff
Patch18: gold-depend-on-opcodes.diff
Patch22: binutils-bfd_h.patch
Patch23: pie-m68k.patch
Patch24: binutils-2.24-auto-plugin.diff
Patch90: cross-avr-nesc-as.patch
Patch92: cross-avr-omit_section_dynsym.patch
Patch93: cross-avr-size.patch
@ -171,6 +172,7 @@ echo "make check will return with %{make_check_handling} in case of testsuite fa
%patch18
%patch22
%patch23 -p1
%patch24 -p1
%if "%{TARGET}" == "avr"
cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h
%patch90

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Mar 21 12:23:43 UTC 2014 - rguenther@suse.com
- Add binutils-2.24-auto-plugin.diff to make plugin auto-load work
for GCC LTO objects. [bso#14698]
-------------------------------------------------------------------
Fri Feb 21 16:59:02 UTC 2014 - matz@suse.de

View File

@ -100,6 +100,7 @@ Patch14: binutils-build-as-needed.diff
Patch18: gold-depend-on-opcodes.diff
Patch22: binutils-bfd_h.patch
Patch23: pie-m68k.patch
Patch24: binutils-2.24-auto-plugin.diff
Patch90: cross-avr-nesc-as.patch
Patch92: cross-avr-omit_section_dynsym.patch
Patch93: cross-avr-size.patch
@ -171,6 +172,7 @@ echo "make check will return with %{make_check_handling} in case of testsuite fa
%patch18
%patch22
%patch23 -p1
%patch24 -p1
%if "%{TARGET}" == "avr"
cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h
%patch90

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Mar 21 12:23:43 UTC 2014 - rguenther@suse.com
- Add binutils-2.24-auto-plugin.diff to make plugin auto-load work
for GCC LTO objects. [bso#14698]
-------------------------------------------------------------------
Fri Feb 21 16:59:02 UTC 2014 - matz@suse.de

View File

@ -100,6 +100,7 @@ Patch14: binutils-build-as-needed.diff
Patch18: gold-depend-on-opcodes.diff
Patch22: binutils-bfd_h.patch
Patch23: pie-m68k.patch
Patch24: binutils-2.24-auto-plugin.diff
Patch90: cross-avr-nesc-as.patch
Patch92: cross-avr-omit_section_dynsym.patch
Patch93: cross-avr-size.patch
@ -171,6 +172,7 @@ echo "make check will return with %{make_check_handling} in case of testsuite fa
%patch18
%patch22
%patch23 -p1
%patch24 -p1
%if "%{TARGET}" == "avr"
cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h
%patch90

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Mar 21 12:23:43 UTC 2014 - rguenther@suse.com
- Add binutils-2.24-auto-plugin.diff to make plugin auto-load work
for GCC LTO objects. [bso#14698]
-------------------------------------------------------------------
Fri Feb 21 16:59:02 UTC 2014 - matz@suse.de

View File

@ -100,6 +100,7 @@ Patch14: binutils-build-as-needed.diff
Patch18: gold-depend-on-opcodes.diff
Patch22: binutils-bfd_h.patch
Patch23: pie-m68k.patch
Patch24: binutils-2.24-auto-plugin.diff
Patch90: cross-avr-nesc-as.patch
Patch92: cross-avr-omit_section_dynsym.patch
Patch93: cross-avr-size.patch
@ -171,6 +172,7 @@ echo "make check will return with %{make_check_handling} in case of testsuite fa
%patch18
%patch22
%patch23 -p1
%patch24 -p1
%if "%{TARGET}" == "avr"
cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h
%patch90

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Mar 21 12:23:43 UTC 2014 - rguenther@suse.com
- Add binutils-2.24-auto-plugin.diff to make plugin auto-load work
for GCC LTO objects. [bso#14698]
-------------------------------------------------------------------
Fri Feb 21 16:59:02 UTC 2014 - matz@suse.de

View File

@ -100,6 +100,7 @@ Patch14: binutils-build-as-needed.diff
Patch18: gold-depend-on-opcodes.diff
Patch22: binutils-bfd_h.patch
Patch23: pie-m68k.patch
Patch24: binutils-2.24-auto-plugin.diff
Patch90: cross-avr-nesc-as.patch
Patch92: cross-avr-omit_section_dynsym.patch
Patch93: cross-avr-size.patch
@ -171,6 +172,7 @@ echo "make check will return with %{make_check_handling} in case of testsuite fa
%patch18
%patch22
%patch23 -p1
%patch24 -p1
%if "%{TARGET}" == "avr"
cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h
%patch90

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Mar 21 12:23:43 UTC 2014 - rguenther@suse.com
- Add binutils-2.24-auto-plugin.diff to make plugin auto-load work
for GCC LTO objects. [bso#14698]
-------------------------------------------------------------------
Fri Feb 21 16:59:02 UTC 2014 - matz@suse.de

View File

@ -100,6 +100,7 @@ Patch14: binutils-build-as-needed.diff
Patch18: gold-depend-on-opcodes.diff
Patch22: binutils-bfd_h.patch
Patch23: pie-m68k.patch
Patch24: binutils-2.24-auto-plugin.diff
Patch90: cross-avr-nesc-as.patch
Patch92: cross-avr-omit_section_dynsym.patch
Patch93: cross-avr-size.patch
@ -171,6 +172,7 @@ echo "make check will return with %{make_check_handling} in case of testsuite fa
%patch18
%patch22
%patch23 -p1
%patch24 -p1
%if "%{TARGET}" == "avr"
cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h
%patch90

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Mar 21 12:23:43 UTC 2014 - rguenther@suse.com
- Add binutils-2.24-auto-plugin.diff to make plugin auto-load work
for GCC LTO objects. [bso#14698]
-------------------------------------------------------------------
Fri Feb 21 16:59:02 UTC 2014 - matz@suse.de

View File

@ -100,6 +100,7 @@ Patch14: binutils-build-as-needed.diff
Patch18: gold-depend-on-opcodes.diff
Patch22: binutils-bfd_h.patch
Patch23: pie-m68k.patch
Patch24: binutils-2.24-auto-plugin.diff
Patch90: cross-avr-nesc-as.patch
Patch92: cross-avr-omit_section_dynsym.patch
Patch93: cross-avr-size.patch
@ -171,6 +172,7 @@ echo "make check will return with %{make_check_handling} in case of testsuite fa
%patch18
%patch22
%patch23 -p1
%patch24 -p1
%if "%{TARGET}" == "avr"
cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h
%patch90

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Mar 21 12:23:43 UTC 2014 - rguenther@suse.com
- Add binutils-2.24-auto-plugin.diff to make plugin auto-load work
for GCC LTO objects. [bso#14698]
-------------------------------------------------------------------
Fri Feb 21 16:59:02 UTC 2014 - matz@suse.de

View File

@ -100,6 +100,7 @@ Patch14: binutils-build-as-needed.diff
Patch18: gold-depend-on-opcodes.diff
Patch22: binutils-bfd_h.patch
Patch23: pie-m68k.patch
Patch24: binutils-2.24-auto-plugin.diff
Patch90: cross-avr-nesc-as.patch
Patch92: cross-avr-omit_section_dynsym.patch
Patch93: cross-avr-size.patch
@ -171,6 +172,7 @@ echo "make check will return with %{make_check_handling} in case of testsuite fa
%patch18
%patch22
%patch23 -p1
%patch24 -p1
%if "%{TARGET}" == "avr"
cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h
%patch90

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Mar 21 12:23:43 UTC 2014 - rguenther@suse.com
- Add binutils-2.24-auto-plugin.diff to make plugin auto-load work
for GCC LTO objects. [bso#14698]
-------------------------------------------------------------------
Fri Feb 21 16:59:02 UTC 2014 - matz@suse.de

View File

@ -100,6 +100,7 @@ Patch14: binutils-build-as-needed.diff
Patch18: gold-depend-on-opcodes.diff
Patch22: binutils-bfd_h.patch
Patch23: pie-m68k.patch
Patch24: binutils-2.24-auto-plugin.diff
Patch90: cross-avr-nesc-as.patch
Patch92: cross-avr-omit_section_dynsym.patch
Patch93: cross-avr-size.patch
@ -171,6 +172,7 @@ echo "make check will return with %{make_check_handling} in case of testsuite fa
%patch18
%patch22
%patch23 -p1
%patch24 -p1
%if "%{TARGET}" == "avr"
cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h
%patch90

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Mar 21 12:23:43 UTC 2014 - rguenther@suse.com
- Add binutils-2.24-auto-plugin.diff to make plugin auto-load work
for GCC LTO objects. [bso#14698]
-------------------------------------------------------------------
Fri Feb 21 16:59:02 UTC 2014 - matz@suse.de

View File

@ -100,6 +100,7 @@ Patch14: binutils-build-as-needed.diff
Patch18: gold-depend-on-opcodes.diff
Patch22: binutils-bfd_h.patch
Patch23: pie-m68k.patch
Patch24: binutils-2.24-auto-plugin.diff
Patch90: cross-avr-nesc-as.patch
Patch92: cross-avr-omit_section_dynsym.patch
Patch93: cross-avr-size.patch
@ -171,6 +172,7 @@ echo "make check will return with %{make_check_handling} in case of testsuite fa
%patch18
%patch22
%patch23 -p1
%patch24 -p1
%if "%{TARGET}" == "avr"
cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h
%patch90

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Mar 21 12:23:43 UTC 2014 - rguenther@suse.com
- Add binutils-2.24-auto-plugin.diff to make plugin auto-load work
for GCC LTO objects. [bso#14698]
-------------------------------------------------------------------
Fri Feb 21 16:59:02 UTC 2014 - matz@suse.de

View File

@ -100,6 +100,7 @@ Patch14: binutils-build-as-needed.diff
Patch18: gold-depend-on-opcodes.diff
Patch22: binutils-bfd_h.patch
Patch23: pie-m68k.patch
Patch24: binutils-2.24-auto-plugin.diff
Patch90: cross-avr-nesc-as.patch
Patch92: cross-avr-omit_section_dynsym.patch
Patch93: cross-avr-size.patch
@ -171,6 +172,7 @@ echo "make check will return with %{make_check_handling} in case of testsuite fa
%patch18
%patch22
%patch23 -p1
%patch24 -p1
%if "%{TARGET}" == "avr"
cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h
%patch90