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

_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to