This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: egcs links wrong libstdc++ and unwanted libgcc.a
- To: law at cygnus dot com
- Subject: Re: egcs links wrong libstdc++ and unwanted libgcc.a
- From: Manfred Hollstein <manfred at s-direktnet dot de>
- Date: Sun, 21 Jun 1998 14:29:24 +0200 (MEST)
- Cc: carlo at runaway dot xs4all dot nl, egcs at cygnus dot com
- References: <199806201915.VAA19131@jolan.ppro>
- Reply-To: manfred at s-direktnet dot de, Manfred dot Hollstein at ks dot sel dot alcatel dot de
On Sat, 20 June 1998, 21:15:35, carlo@runaway.xs4all.nl wrote:
> I still have g++-2.8.1 installed, and egcs uses the stdc++ library
> from that distribution - isn't that a bug?
>
> Moreover, I have no libgcc installed on my machine, because I insist on
> nothing being linked with it.
> However, after installing egcs I find out that it links statically with
> libgcc.a, while that isn't needed at all to make it work.
Another reason for installing libstdc++ in $(libsubdir)?!?!?
manfred
>
> Comments please?
>
> Carlo Wood
>
> -------------------------------------------------------------------------------
> #Comments &
> >Commands
>
> # The normal command I use to create the final (test) program:
> >egcs++ -v crosslink_tst.o -L../../../lib -lr -o crosslink_tst
> Reading specs from /usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.90.29/specs
> gcc version egcs-2.90.29 980515 (egcs-1.0.3 release)
> /usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.90.29/ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o crosslink_tst /usr/lib/crt1.o /usr/lib/crti.o /usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.90.29/crtbegin.o -L../../../lib -L/usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.90.29 -L/usr/local/egcs/i686-pc-linux-gnu/lib -L/usr/local/egcs/lib crosslink_tst.o -lr -lstdc++ -lm -lgcc -lc -lgcc /usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.90.29/crtend.o /usr/lib/crtn.o
> >
>
> # Being paranoid, I move the libgcc.a that came with the egcs distribution away:
> >mv /usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.90.29/libgcc.a /usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.90.29/libgcc.a.away
> >
>
> # And try what happens:
> >egcs++ -v crosslink_tst.o -L../../../lib -lr -o crosslink_tst
> Reading specs from /usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.90.29/specs
> gcc version egcs-2.90.29 980515 (egcs-1.0.3 release)
> /usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.90.29/ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o crosslink_tst /usr/lib/crt1.o /usr/lib/crti.o /usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.90.29/crtbegin.o -L../../../lib -L/usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.90.29 -L/usr/local/egcs/i686-pc-linux-gnu/lib -L/usr/local/egcs/lib crosslink_tst.o -lr -lstdc++ -lm -lgcc -lc -lgcc /usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.90.29/crtend.o /usr/lib/crtn.o
> /usr/bin/ld: cannot open -lgcc: No such file or directory
> collect2: ld returned 1 exit status
> >
>
> # This is the same command, but simply leaving away the two -lgcc:
> >/usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.90.29/ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o crosslink_tst /usr/lib/crt1.o /usr/lib/crti.o /usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.90.29/crtbegin.o -L../../../lib -L/usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.90.29 -L/usr/local/egcs/i686-pc-linux-gnu/lib -L/usr/local/egcs/lib crosslink_tst.o -lr -lstdc++ -lm -lc /usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.90.29/crtend.o /usr/lib/crtn.o
> >
> # This works thus :/
>
> # Looking at the shared libraries it is using, I find out it uses
> # /usr/lib/libstdc++.so.2.8 instead of /usr/local/egcs/lib/libstdc++.so.2.8
> # What is the deal with that?
> >ldd crosslink_tst
> libr.so.0 => /home/carlo/c++/libr/lib/libr.so.0 (0x40000000)
> libstdc++.so.2.8 => /usr/lib/libstdc++.so.2.8 (0x4009d000)
> libm.so.6 => /lib/libm.so.6 (0x400df000)
> libc.so.6 => /lib/libc.so.6 (0x400f8000)
> /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00000000)
>