AnsweredAssumed Answered

Yocto library link error(real-ld): cannot find /lib/libc.so.6

Question asked by Hirotoshi Sato on Apr 19, 2018
Latest reply on Jun 26, 2018 by Hirotoshi Sato

Hi, 

 

I try to compile a C program using pcap with Eclipse and Yocto ADT.

After building, I got errors as bottom (config.log).

 

  • There are several errors.
  1. arm-fslc-linux-gnueabi-gcc: error: unrecognized command line option '-V'
  2. arm-fslc-linux-gnueabi-gcc: error: unrecognized command line option '-qversion'; did you mean '--version'?
  3. /opt/fslc-framebuffer/2.2.1/sysroots/x86_64-fslcsdk-linux/usr/libexec/arm-fslc-linux-gnueabi/gcc/arm-fslc-linux-gnueabi/6.2.0/real-ld: cannot find /lib/libc.so.6
    /opt/fslc-framebuffer/2.2.1/sysroots/x86_64-fslcsdk-linux/usr/libexec/arm-fslc-linux-gnueabi/gcc/arm-fslc-linux-gnueabi/6.2.0/real-ld: cannot find /usr/lib/libc_nonshared.a
    /opt/fslc-framebuffer/2.2.1/sysroots/x86_64-fslcsdk-linux/usr/libexec/arm-fslc-linux-gnueabi/gcc/arm-fslc-linux-gnueabi/6.2.0/real-ld: cannot find /lib/ld-linux-armhf.so.3
    collect2: error: ld returned 1 exit status

 

I think the error 1 and 2 can be ignored (If there are solutions, please teach me).

However the error 3 says it cannot link library and C compiler cannot create executables.

How can I solve this error?

 

My environment:

Eclipse settings:

  • Properties>Autotools>Configure settings>configure>Command:
    CFLAGS=" -g -O0  -I/home/user/var-fslc-yocto/build_fb/tmp/sysroots/imx6ul-var-dart/usr/include --sysroot=/opt/fslc-framebuffer/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi" CXXFLAGS=" -g -O0  --sysroot=/opt/fslc-framebuffer/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi" LDFLAGS=" -L/opt/fslc-framebuffer/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi -L/home/user/var-fslc-yocto/build_fb/tmp/sysroots/imx6ul-var-dart -L/home/user/var-fslc-yocto/build_fb/tmp/sysroots/imx6ul-var-dart/usr/lib  --sysroot=/opt/fslc-framebuffer/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi" CPPFLAGS=" --sysroot=/opt/fslc-framebuffer/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi" configure --with-libtool-sysroot=/opt/fslc-framebuffer/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi 
  • All options:
     --host=arm-fslc-linux-gnueabi --build=x86_64-linux --target=arm-fslc-linux-gnueabi  

 

What I checked

  • under sysroots (=/opt/fslc-framebuffer/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi ), there are lib/libc.so.6, usr/lib/libc_nonshared.a, lib/ld-linux-armhf.so.3. However config.log says cannot find them.
  • Yocto libc linker error while building application  this link treat the same problem, but I cannot understan what I should do (I think I may set the same settings as this link.).

 

config.log

configure:3187: arm-fslc-linux-gnueabi-gcc -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard --sysroot=/opt/fslc-framebuffer/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi -V >&5
arm-fslc-linux-gnueabi-gcc: error: unrecognized command line option '-V'
arm-fslc-linux-gnueabi-gcc: fatal error: no input files
compilation terminated.
configure:3198: $? = 1
configure:3187: arm-fslc-linux-gnueabi-gcc -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard --sysroot=/opt/fslc-framebuffer/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi -qversion >&5
arm-fslc-linux-gnueabi-gcc: error: unrecognized command line option '-qversion'; did you mean '--version'?
arm-fslc-linux-gnueabi-gcc: fatal error: no input files
compilation terminated.
configure:3198: $? = 1
configure:3218: checking whether the C compiler works
configure:3240: arm-fslc-linux-gnueabi-gcc -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard --sysroot=/opt/fslc-framebuffer/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi -g -O0 -I/home/user/var-fslc-yocto/build_fb/tmp/sysroots/imx6ul-var-dart/usr/include --sysroot=/opt/fslc-framebuffer/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi --sysroot=/opt/fslc-framebuffer/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi -L/opt/fslc-framebuffer/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi -L/home/user/var-fslc-yocto/build_fb/tmp/sysroots/imx6ul-var-dart -L/home/user/var-fslc-yocto/build_fb/tmp/sysroots/imx6ul-var-dart/usr/lib --sysroot=/opt/fslc-framebuffer/2.2.1/sysroots/armv7at2hf-neon-fslc-linux-gnueabi conftest.c >&5
/opt/fslc-framebuffer/2.2.1/sysroots/x86_64-fslcsdk-linux/usr/libexec/arm-fslc-linux-gnueabi/gcc/arm-fslc-linux-gnueabi/6.2.0/real-ld: cannot find /lib/libc.so.6
/opt/fslc-framebuffer/2.2.1/sysroots/x86_64-fslcsdk-linux/usr/libexec/arm-fslc-linux-gnueabi/gcc/arm-fslc-linux-gnueabi/6.2.0/real-ld: cannot find /usr/lib/libc_nonshared.a
/opt/fslc-framebuffer/2.2.1/sysroots/x86_64-fslcsdk-linux/usr/libexec/arm-fslc-linux-gnueabi/gcc/arm-fslc-linux-gnueabi/6.2.0/real-ld: cannot find /lib/ld-linux-armhf.so.3
collect2: error: ld returned 1 exit status
configure:3244: $? = 1
configure:3282: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "packetcapture"
| #define PACKAGE_TARNAME "packetcapture"
| #define PACKAGE_VERSION "0.1.0"
| #define PACKAGE_STRING "packetcapture 0.1.0"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define PACKAGE "packetcapture"
| #define VERSION "0.1.0"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:3287: error: in `/home/user/workspace/packetcapture':
configure:3289: error: C compiler cannot create executables
See `config.log' for more details

Outcomes