This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

linking correct libc


Yann E. MORIN wrote:
Thomas,
All,

On Friday 22 May 2009 19:27:53 Thomas Petazzoni wrote:
Starting with gcc 4.x, toolchains can support the "sysroot"
functionnality (this is optional). It allows to change the installation
location of the toolchain, but if you do change this installation
location, then you must pass a --sysroot option pointing to the
directory where the toolchain is installed. So toolchains based on gcc
4.x compiled with sysroot support are relocatable, but it requires some
explicit flag passed by the user.

Passing --sysroot at runtime should not be needed. From the gcc installation instructions:

-----8<-----
  --with-sysroot=dir
    [...] If the specified directory is a subdirectory of ${exec_prefix},
    then it will be found relative to the GCC binaries if the installation
    tree is moved.
-----8<-----

And from my experiments, it works as advertised, for once! :-]

Regards,
Yann E. MORIN.


Hi ,


this question of --sysroot is giving me problems

CFLAGS="-march=armv4t" CPPFLAGS="--sysroot=/back/ts/ct-ng/x-tools/arm-unknown-linux-gnueabi/ -I/back/ts/root2/usr/include" LDFLAGS="-L/back/ts/root2/usr/lib/" make
arm-unknown-linux-gnueabi-gcc -L/back/ts/root2/usr/lib/ -pie portmap.o pmap_check.o from_local.o -lwrap -o portmap
/back/ts/ct-ng/x-tools/arm-unknown-linux-gnueabi/lib/gcc/arm-unknown-linux-gnueabi/4.3.2/../../../../arm-unknown-linux-gnueabi/bin/ld: skipping incompatible /lib/libc.so.6 when searching for /lib/libc.so.6
/back/ts/ct-ng/x-tools/arm-unknown-linux-gnueabi/lib/gcc/arm-unknown-linux-gnueabi/4.3.2/../../../../arm-unknown-linux-gnueabi/bin/ld: cannot find /lib/libc.so.6
collect2: ld returned 1 exit status
make: *** [portmap] Error 1



the -I and -L options enable it to find the headers tcpd.h and to link -lwrap , however it seems to hit the HOST libc instead of the eabi build. I'm not even sure why the cross-compiled ld is looking /lib


Is this just me misusing the tools or is something incorrectly configured.

I have a working kernel and busybox (ie it boots), and untested be clean installations of tcp-wrappers, sysvinit, gzip zlib and dropbear but I've spend several days now banging my head on this libc problem.

Thanks for any help in getting this moving forwards.


-- For unsubscribe information see http://sourceware.org/lists.html#faq


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