linking correct libc

Yann E. MORIN yann.morin.1998@anciens.enib.fr
Tue May 26 07:02:00 GMT 2009


Peter,
All,

On Tuesday 26 May 2009 07:07:28 ng@piments.com wrote:
>    CFLAGS="-march=armv4t"  CPPFLAGS="-I/back/ts/root2/usr/include" 
> LDFLAGS="-L/back/ts/root2/usr/lib/"  make
> arm-unknown-linux-gnueabi-gcc -march=armv4t -Wall -Wstrict-prototypes 
> -fpie -I/back/ts/root2/usr/include -DHOSTS_ACCESS -DCHECK_PORT 
> -DIGNORE_SIGCHLD    -DFACILITY=LOG_DAEMON   -c -o portmap.o portmap.c
> arm-unknown-linux-gnueabi-gcc -march=armv4t -Wall -Wstrict-prototypes 
> -fpie -I/back/ts/root2/usr/include -DHOSTS_ACCESS -DCHECK_PORT 
> -DIGNORE_SIGCHLD    -DFACILITY=LOG_DAEMON   -c -o pmap_check.o pmap_check.c
> arm-unknown-linux-gnueabi-gcc -march=armv4t -Wall -Wstrict-prototypes 
> -fpie -I/back/ts/root2/usr/include -DHOSTS_ACCESS -DCHECK_PORT 
> -DIGNORE_SIGCHLD    -DFACILITY=LOG_DAEMON   -c -o from_local.o from_local.c

So far, all good.

> arm-unknown-linux-gnueabi-gcc -L/back/ts/root2/usr/lib/ -pie  portmap.o 
> pmap_check.o from_local.o  -lwrap -o portmap

All input .o files should be ARM files, they got build just above. Just
check libwrap is an ARM binary too, just to be sure it got cross-compiled:
file /back/ts/root2/usr/lib/libwrap.so*

If it is really an ARM file, you can run again, but setting:
LDFLAGS="-L/back/ts/root2/usr/lib/ -v -Wl,--verbose"

The output is quite verbose, but you'll see exactly what ld is trying
to do...

> So I would say : no, the toolchain is not working correctly in this case.

Not so sure... ;-)

> 1/ It is really finding /lib/libc.so.6 (ie the host x86 library) as 
> indicated by the output but contrary to the -print-search-dirs paths.

Maybe, just check libwrap, as stated above.

> 2/ It is looking in the right place but finding something different to 
> what is expected.

EABI and endianness come to mind. The verbose ld logs, above, will
tell.

> 3/ It is finding a good libc but erroneously calling it incompatible.

Nope.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +0/33 662376056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| --==< ^_^ >==-- `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
`------------------------------^-------^------------------^--------------------'


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



More information about the crossgcc mailing list