[OE-core] [poky][Question]cross build error.
Bian Naimeng
biannm at cn.fujitsu.com
Mon Sep 9 06:58:24 UTC 2013
Hi all,
If link library of distribution which built by Yocto-1.4.x,
the following error will be caught.
# /opt/poky-lsb/1.4.1/sysroots/x86_64-pokysdk-linux/usr/bin/x86_64-poky-linux/x86_64-poky-linux-gcc \
-o helloworld helloworld.c -L /opt/mydistro/usr/lib -l xxx
/opt/poky-lsb/1.4.1/sysroots/x86_64-pokysdk-linux/usr/libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/4.7.2/ld:
skipping incompatible /lib/libc.so.6 when searching for /lib/libc.so.6
/opt/poky-lsb/1.4.1/sysroots/x86_64-pokysdk-linux/usr/libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/4.7.2/ld:
cannot find /lib/libc.so.6
/opt/poky-lsb/1.4.1/sysroots/x86_64-pokysdk-linux/usr/libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/4.7.2/ld:
skipping incompatible /usr/lib/libc_nonshared.a when searching for /usr/lib/libc_nonshared.a
/opt/poky-lsb/1.4.1/sysroots/x86_64-pokysdk-linux/usr/libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/4.7.2/ld:
cannot find /usr/lib/libc_nonshared.a
/opt/poky-lsb/1.4.1/sysroots/x86_64-pokysdk-linux/usr/libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/4.7.2/ld:
cannot find /lib/ld-linux-x86-64.so.2
collect2: error: ld returned 1 exit status
It can be avoid by changing the sysroot to "/opt/mydistro".
# /opt/poky-lsb/1.4.1/sysroots/x86_64-pokysdk-linux/usr/bin/x86_64-poky-linux/x86_64-poky-linux-gcc \
-o helloworld helloworld.c -L /usr/lib -l xxx --sysroot /opt/mydistro
The default sysroot is "/opt/poky-lsb/1.4.1/sysroots/x86_64-poky-linux",
but why cross gcc finds libc.so.6 from /opt/mydistro/
# cat /opt/poky-lsb/1.4.1/environment-setup-x86_64-poky-linux | grep sysroot
... ...
CC="x86_64-poky-linux-gcc -m64 --sysroot=/opt/poky-lsb/1.4.1/sysroots/x86_64-poky-linux"
... ...
Any suggestion?
Thanks
Bian
More information about the Openembedded-core
mailing list