RE: [arm-gnu] RE: skipping incompatible /lib/libc.so.6 when searching for /lib/libc.so.6
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [arm-gnu] RE: skipping incompatible /lib/libc.so.6 when searching for /lib/libc.so.6



> -----Original Message-----
> From: Bertrand Szoghy [mailto:webmaster@xxxxxxxxxxxx]
> Sent: Friday, 24 December 2010 3:53 AM
.....
>
/home/bertrand/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-
> gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld:
> skipping incompatible /lib/libc.so.6 when searching for /lib/libc.so.6
>
/home/bertrand/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-
> gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld:
> cannot find /lib/libc.so.6
> collect2: ld returned 1 exit status
> make: *** [sapi/cgi/php-cgi] Error 1

This seems like a problem I had cross compiling a while back. I can't
remember exact details but it was related to when you are building .so files
that need other .so files, then try and build the application and the
"cascaded" .so resolution.

I tracked it down to contents of the CodeSoucery libc.so file.

[robertj@greebo ~]$ cat
/opt/CodeSourcery/Sourcery_G++_Lite/arm-none-linux-gnueabi/libc/armv4t/usr/l
ib/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 ) )


As you can see the cross compiler library file is actually pointing to the
host system libraries, hence the "incompatible ...." error.


My solution was to create a libc.so file in the source directory which has
the correct paths then use the "-Wl,-nostdlib -L." Flags to make my modified
one is used. I am trying to simplify as I had other complications involving
configure scripts ...

You could plausibly just edit the file in the CodeSoucery tree too, though I
did not want to change an installed tool, too hard to manage across multiple
developers.


Robert Jongbloed
OPAL/OpenH323/PTLib Architect and Co-founder.