This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: egcs links wrong libstdc++ and unwanted libgcc.a


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)
 > 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]