[uClibc] uclibc-gcc using wrong libraries when compiling?

Scott Stickeler scott at guy-smiley.com
Thu Apr 8 17:33:11 UTC 2004


Hi Tom,
  Yes PowerPC uses ELF. I will take a look and see which library the static
build is pulling in. I know that the dynamic build is pulling in libc.so.0 but
I am not sure from where ( readelf just has the name of the file, not the path
). 

  The weird thing with the library search path in gcc is the first path starts
with an '=' and the other thing is that all the paths except the last one
listed do not contain the uclibc libraries. It looks like when GCC is built, it
is being passed the wrong library paths.


-Scott

Quoting tom at ceisystems.com:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Scott,
> 	Assuming PowerPC uses an ELF format (I've _never_ used Linux on
> PPC, so I have no idea)...you can always use the tool "readelf" to read
> the compiled file, and find what libs it's linking to.  I don't know how
> well this would work if you're native arch isn't PowerPC, as the
> endianness would be incorrect.  Either way, it would seem that all the
> compilers, etc are in proper at a _very_ first glance.
> 
> Keep us Posted (tm)
> Tom Cameron
>  
> 
> > -----Original Message-----
> > From: uclibc-bounces at uclibc.org 
> > [mailto:uclibc-bounces at uclibc.org] On Behalf Of Scott Stickeler
> > Sent: Thursday, April 08, 2004 1:37 AM
> > To: uclibc at uclibc.org
> > Subject: [uClibc] uclibc-gcc using wrong libraries when compiling?
> > 
> > 
> > 
> > Hi,
> >   I built the toolchain for PPC last night from the latest 
> > uclibc build. I got the toolchain to compile and I tried 
> > compiling a simple "Hello World" app:
> > 
> > #include <stdio.h>
> > 
> > void main ( void )
> > {
> >   printf("Hello World");
> > }
> > 
> > If I use statically link the executable is 232339 bytes. If I 
> > dynamic link it is 8830 bytes. This seemed really big to me 
> > so I tried compiling the exact same file using gcc that uses 
> > glibc and got the same results. I suspect the compiler is 
> > pulling in the wrong library ( not using uclibc ) but I 
> > thought the uclibc tool installer would take care of this. If 
> > I do a 'powerpc-linux-uclibc-gcc -print-search-dirs' I get:
> > 
> > install:
> > /home/scott/toolchain/gcc-3.3.x/toolchain_powerpc_nofpu/lib/gc
> > c-lib/powerpc-linux-uclibc/3.3.3/
> > programs:
> > =/home/scott/toolchain/gcc-3.3.x/toolchain_powerpc_nofpu/lib/g
> > cc-lib/powerpc-linux-uclibc/3.3.3/:/home/scott/toolchain/gcc-3
> .3.x/toolchain_powerpc_nofpu/lib/gcc-lib/powerpc-linux->
> uclibc/3.3.3/:/home/scott/toolchain/gcc-3.3.x/toolchain_powerp
> > c_nofpu/lib/gcc-lib/powerpc-linux-uclibc/:/usr/lib/gcc/powerpc
> > -linux-uclibc/3.3.3/:/usr/lib/gcc/powerpc-linux-uclibc/:/home/
> scott/toolchain/gcc-3.3.x/toolchain_powerpc_nofpu/lib/gcc->
> lib/powerpc-linux-uclibc/3.3.3/../../../../powerpc-linux-uclib
> c/bin/powerpc-linux->
> uclibc/3.3.3/:/home/scott/toolchain/gcc-3.3.x/toolchain_powerp
> > c_nofpu/lib/gcc-lib/powerpc-linux-uclibc/3.3.3/../../../../pow
> erpc-linux-uclibc/bin/
> > libraries:
> > =/home/scott/toolchain/gcc-3.3.x/toolchain_powerpc_nofpu/lib/g
> > cc-lib/powerpc-linux-uclibc/3.3.3/:/usr/lib/gcc/powerpc-linux-
> > uclibc/3.3.3/:/home/scott/toolchain/gcc-3.3.x/toolchain_powerp
> > c_nofpu/lib/gcc-lib/powerpc-linux-uclibc/3.3.3/../../../../pow
> erpc-linux-uclibc/lib/powerpc-linux->
> uclibc/3.3.3/:/home/scott/toolchain/gcc-3.3.x/toolchain_powerp
> > c_nofpu/lib/gcc-lib/powerpc-linux-uclibc/3.3.3/../../../../pow
> erpc-linux-uclibc/lib/
> > 
> > The libraries paths seem weird. Is this the problem or am I 
> > missing something?
> > 
> > Thanks,
> > Scott
> > _______________________________________________
> > uClibc mailing list
> > uClibc at uclibc.org
> > http://uclibc.org/mailman/listinfo/uclibc
> > 
> > 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.6 (MingW32)
> Comment: For info see http://www.gnupg.org
> 
> iEYEARECAAYFAkB07UoACgkQCnk9/RTg1dB34gCfXyuQyZQY5g6pIye9AZW9bzxn
> 1hoAn2nOU6JTgmVIvOMbUQNCoeie4b2V
> =reGW
> -----END PGP SIGNATURE-----
> 
> 






More information about the uClibc mailing list