Richard Biener <[email protected]> writes:
> On Mon, 10 Mar 2014, Rainer Orth wrote:
>
>> Richard Biener <[email protected]> writes:
>>
>> > Ouch. But as lto-plugin is a host module it should link against
>> > the host libgcc, no? During stage1, that is. So the question is
>> > why does it use the gcc/ compiler....?
>> >
>> > For me it's using the host gcc:
>> >
>> > gcc -DHAVE_CONFIG_H -I. -I/space/rguenther/tramp3d/trunk/lto-plugin
>> > -I/space/rguenther/tramp3d/trunk/lto-plugin/../include -DHAVE_CONFIG_H
>> > -Wall -g -c /space/rguenther/tramp3d/trunk/lto-plugin/lto-plugin.c -fPIC
>> > -DPIC -o .libs/lto-plugin.o
>> > /bin/sh ./libtool --tag=CC --tag=disable-static --mode=link gcc -Wall -g
>> > -module -bindir /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.9.0
>> > -static-libstdc++ -static-libgcc -o liblto_plugin.la -rpath
>> > /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.9.0 lto-plugin.lo
>> > -Wc,../libiberty/pic/libiberty.a
>> > libtool: link: gcc -shared .libs/lto-plugin.o
>> > ../libiberty/pic/libiberty.a -Wl,-soname -Wl,liblto_plugin.so.0 -o
>> > .libs/liblto_plugin.so.0.0.0
>>
>> It does use the host compiler for me, too.
>
> So then if it succeeds to link to a shared libgcc_s then why
> is it not able to find that later? Maybe you miss setting
> of a suitable LD_LIBRARY_PATH to pick up the runtime for
> your host compiler?
For the same reason that we use -static-libstdc++ to avoid this issue
for libstdc++.so. I've always considered gcc's tendency to build
binaries that don't run by default a major annoyance, all the weasel
wording in the FAQ nonwithstanding. I hope to finally do something
about it for 4.10/5.0 (btw., any word on what the next release is going
to be?).
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University