[patch lto-plugin]: Part 2 for PR lto/47225 - [4.6 regression]: cross-compile fails while configuring libgcc with "xgcc: fatal error: -fuse-linker-plugin, but liblto_plugin.so not found"

Kai Tietz ktietz70@googlemail.com
Mon Feb 7 18:32:00 GMT 2011


2011/2/7 Andreas Krebbel <krebbel@linux.vnet.ibm.com>:
>> Hmm, so it adds it to dependency. Feel free to revert the patch, I'll
>> try to rework it. Does it make any difference here, if the initial '-'
>> is put before $(Wl) and the leading minus is removed from Wl
>> definition?
>>
>> I am a bit puzzled as it worked for me.
>
> From a quick look the problem appears to be that your Makefile.am change doesn't only
> affect liblto_plugin_la_LIBADD. It also affects liblto_plugin_la_DEPENDENCIES:
>
> From your patch Makefile.in:
>
>
>  liblto_plugin_la_DEPENDENCIES = $(if $(wildcard \
> -       ../libiberty/pic/libiberty.a),../libiberty/pic/libiberty.a,)
> +       ../libiberty/pic/libiberty.a),$(Wl)../libiberty/pic/libiberty.a,)
>
>
> which is used as rule dependency:
>
> liblto_plugin.la: $(liblto_plugin_la_OBJECTS) $(liblto_plugin_la_DEPENDENCIES)
>        $(liblto_plugin_la_LINK) -rpath $(libexecsubdir) $(liblto_plugin_la_OBJECTS)
> $(liblto_plugin_la_LIBADD) $(LIBS)
>
> -Andreas-
>

Hi Andreas,

the generated dependency is the issue here. Could you test this patch
for s390 (or some other pic target). The following patch bootstraps
successful for x86_64-w64-mingw32, and x86_64-pc-linux-gnu.

Ok for apply?

Thanks in advance,
Kai
-------------- next part --------------
Index: Makefile.am
===================================================================
--- Makefile.am	(revision 169890)
+++ Makefile.am	(working copy)
@@ -14,10 +14,11 @@
 libexecsub_LTLIBRARIES = liblto_plugin.la
 
 liblto_plugin_la_SOURCES = lto-plugin.c
-liblto_plugin_la_LIBADD = \
-	$(if $(wildcard ../libiberty/pic/libiberty.a),../libiberty/pic/libiberty.a,)
+liblto_plugin_la_LIBADD =
+
 # Note that we intentionally override the bindir supplied by ACX_LT_HOST_FLAGS
 liblto_plugin_la_LDFLAGS = $(lt_host_flags) -bindir $(libexecsubdir) \
+	$(if $(wildcard ../libiberty/pic/libiberty.a),../libiberty/pic/libiberty.a,) \
 	$(if $(wildcard ../libiberty/pic/libiberty.a),,-Wc,../libiberty/libiberty.a)
 
 all: copy_lto_plugin
Index: Makefile.in
===================================================================
--- Makefile.in	(revision 169890)
+++ Makefile.in	(working copy)
@@ -81,8 +81,7 @@
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
 am__installdirs = "$(DESTDIR)$(libexecsubdir)"
 LTLIBRARIES = $(libexecsub_LTLIBRARIES)
-liblto_plugin_la_DEPENDENCIES = $(if $(wildcard \
-	../libiberty/pic/libiberty.a),../libiberty/pic/libiberty.a,)
+liblto_plugin_la_DEPENDENCIES =
 am_liblto_plugin_la_OBJECTS = lto-plugin.lo
 liblto_plugin_la_OBJECTS = $(am_liblto_plugin_la_OBJECTS)
 liblto_plugin_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
@@ -233,11 +232,11 @@
 AM_LIBTOOLFLAGS = --tag=disable-static
 libexecsub_LTLIBRARIES = liblto_plugin.la
 liblto_plugin_la_SOURCES = lto-plugin.c
-liblto_plugin_la_LIBADD = \
-	$(if $(wildcard ../libiberty/pic/libiberty.a),../libiberty/pic/libiberty.a,)
+liblto_plugin_la_LIBADD = 
 
 # Note that we intentionally override the bindir supplied by ACX_LT_HOST_FLAGS
 liblto_plugin_la_LDFLAGS = $(lt_host_flags) -bindir $(libexecsubdir) \
+	$(if $(wildcard ../libiberty/pic/libiberty.a),../libiberty/pic/libiberty.a,) \
 	$(if $(wildcard ../libiberty/pic/libiberty.a),,-Wc,../libiberty/libiberty.a)
 
 all: config.h


More information about the Gcc-patches mailing list