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]

Re: linking correct libc


Yann E. MORIN wrote:
"ng",
All,

On Sunday 24 May 2009 22:09:27 ng@piments.com wrote:
Yann E. MORIN wrote:
It is *not* needed to pass --sysroot to the compielrs build with
crosstool-NG.
thanks, I realised that , it was an attempt to verofu what was happening by explicitly specifying everything. When it made no difference I concluded the built-in sysroot was correctly interpreted and the problem lay elsewhere.

So, your toolchain is working, and you are trying to reproduce gcc's internal logic by passing args on the command line, right?

What does the follwing command says:
/back/ts/ct-wkg//x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc \
was something missed off after the \ :?

Yes, sorry: bla-bla-gcc -print-search-dirs
voila:

/back/ts/ct-wkg//x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc -print-search-dirs
install: /back/ts/ct-wkg/x-tools/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/4.3.2/
programs: =/back/ts/ct-wkg/x-tools/arm-unknown-linux-gnueabi/bin/../libexec/gcc/arm-unknown-linux-gnueabi/4.3.2/:/back/ts/ct-wkg/x-tools/arm-unknown-linux-gnueabi/bin/../libexec/gcc/:/back/ts/ct-wkg/x-tools/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/4.3.2/../../../../arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi/4.3.2/:/back/ts/ct-wkg/x-tools/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/4.3.2/../../../../arm-unknown-linux-gnueabi/bin/
libraries: =/back/ts/ct-wkg/x-tools/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/4.3.2/:/back/ts/ct-wkg/x-tools/arm-unknown-linux-gnueabi/bin/../lib/gcc/:/back/ts/ct-wkg/x-tools/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/4.3.2/../../../../arm-unknown-linux-gnueabi/lib/arm-unknown-linux-gnueabi/4.3.2/:/back/ts/ct-wkg/x-tools/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/4.3.2/../../../../arm-unknown-linux-gnueabi/lib/:/back/ts/ct-wkg/x-tools/arm-unknown-linux-gnueabi/bin/../arm-unknown-linux-gnueabi//sys-root/lib/arm-unknown-linux-gnueabi/4.3.2/:/back/ts/ct-wkg/x-tools/arm-unknown-linux-gnueabi/bin/../arm-unknown-linux-gnueabi//sys-root/lib/:/back/ts/ct-wkg/x-tools/arm-unknown-linux-gnueabi/bin/../arm-unknown-linux-gnueabi//sys-root/usr/lib/arm-unknown-linux-gnueabi/4.3.2/:/back/ts/ct-wkg/x-tools/arm-unknown-linux-gnueabi/bin/../arm-unknown-linux-gnueabi//sys-root/usr/lib/



/back/ts/ct-wkg//x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc \ -print-file-name=libc.so
/back/ts/ct-wkg/x-tools/arm-unknown-linux-gnueabi/bin/../arm-unknown-linux-gnueabi//sys-root/usr/lib/libc.so

OK.


cat /back/ts/ct-wkg/x-tools/arm-unknown-linux-gnueabi/bin/../arm-unknown-linux-gnueabi//sys-root/usr/lib/libc.so
/* GNU ld script
Use the shared library, but some functions are only in
the static library, so try that secondarily. */
OUTPUT_FORMAT(elf32-littlearm)
GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /lib/ld-linux.so.3 ) )
OK , so that explains the reference to /lib/libc.so.6 , is that what you would expect to see here?

Yes, correct. Those are paths relative to the sysroot, so gcc will hapilly find them. BTW, notice: ld-linux.so.3 -> EABI-era dynamic linker, good.

To conclude this thread: does your toolchain correctly works by default?

Well it builds a bootable kernel and busybox but I can't get past this incompatible /lib/libc.so.6 error in portmap.


CPPFLAGS="-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



Since that /lib/libc.so.6 would appear to be the sys-root one and you say that file looks good, why is it crapping out and declaring this file "incompatible"?


Thanks again.


Regards,
Yann E. MORIN.



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