Openembedded Core Discussions
 help / color / mirror / Atom feed
* [poky][Question]cross build error.
@ 2013-09-09  6:58 Bian Naimeng
  0 siblings, 0 replies; only message in thread
From: Bian Naimeng @ 2013-09-09  6:58 UTC (permalink / raw)
  To: poky; +Cc: openembedded-core

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



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-09-09  6:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-09  6:58 [poky][Question]cross build error Bian Naimeng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox