bitbake failed to compile - ld cannot find -lc
Hello All,
I'm a newbie to Yocto.
I'm setting up a project using poky warrior branch. I set up SDKMACHINE="x86_64"
Target arch is powerpc-nf
The goal is to create sdk image to be used for other development.
I include the following packages in conf/local.conf and many others (but may not be important to discuss here) IMAGE_INSTALL_append += " libgcc "IMAGE_INSTALL_append += " glibc glibc-dev "IMAGE_INSTALL_append += " glibc-staticdev "EXTRA_IMAGE_FEATURES += "tools-sdk"EXTRA_IMAGE_FEATURES += "dev-pkgs"SDKIMAGE_FEATURES_append = " staticdev-pkgs "
I am able to "bitbake core-image-minimal" and "bitbake core-image-minimal -c populate_sdk" successfully.
Then I added another code to handle root access... This code was built fine outside of yocto environment.
Here is the recipe
**********************************************
LICENSE = "Apache-2.0"LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
SRC_URI = "file://mdchroot-${PV}.tar.gz \
file://mcpbug-121262-bind_mounting_resource_leak.patch \
file://mdchroot-make-depend.patch\
file://mdchroot.spec \
"
SRC_URI[md5sum] = "e84606060949ce161bae2a00ad8359fb"
SRC_URI[sha256sum] = "2a9801ca9ec9d3b120c13b61c0ed778d07adb4f75fe8357bc738dda9f8aa6dae"
BBCLASSEXTEND = "native nativesdk"
inherit autotools
do_compile () {
# You will almost certainly need to add additional arguments here cd ${S}
unset LDFLAGS CFLAGS CPPFLAGS
make OPTIMIZE=-O2 DEBUG=-g DEFINES=-D_GNU_SOURCE
}
**********************************************
I tried to build "bitbake mdchroot-native" and it failed
**********************************************
Initialising tasks: 100% |###############################################################################################################################| Time: 0:00:00
Sstate summary: Wanted 1 Found 0 Missed 1 Current 8 (0% match, 88% complete)
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: mdchroot-native-0.7.4-r0 do_compile: Function failed: do_compile (log file is located at /tmp/youhour/fips-build/fips-ppcnf/build/tmp/work/x86_64-linux/mdchroot-native/0.7.4-r0/temp/log.do_compile.30014)
ERROR: Logfile of failure stored in: /tmp/youhour/fips-build/fips-ppcnf/build/tmp/work/x86_64-linux/mdchroot-native/0.7.4-r0/temp/log.do_compile.30014
Log data follows:
| DEBUG: Executing shell function do_compile
| gcc -Wall -Werror -D_GNU_SOURCE -O2 -g -o src/mdchroot src/mdchroot.o src/mount_table.o src/mount.o src/roots.o -static
*| /tmp/youhour/fips-build/fips-ppcnf/build/tmp/hosttools/ld: cannot find -lc*
*| collect2: error: ld returned 1 exit status*
| make: *** [src/mdchroot] Error 1 | WARNING: /tmp/youhour/fips-build/fips-ppcnf/build/tmp/work/x86_64-linux/mdchroot-native/0.7.4-r0/temp/run.do_compile.30014:1 exit 2 from 'make OPTIMIZE=-O2 DEBUG=-g DEFINES=-D_GNU_SOURCE' | ERROR: Function failed: do_compile (log file is located at /tmp/youhour/fips-build/fips-ppcnf/build/tmp/work/x86_64-linux/mdchroot-native/0.7.4-r0/temp/log.do_compile.30014)
ERROR: Task (virtual:native:/esw/san5/youhour/yocto_mcp/b20200123a/fips-build/meta-fips-dependencies/recipes-phosphor/mdchroot/mdchroot_0.7.4.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 63 tasks of which 62 didn't need to be rerun and 1 failed.
Summary: 1 task failed:
virtual:native:/esw/san5/youhour/yocto_mcp/b20200123a/fips-build/meta-fips-dependencies/recipes-phosphor/mdchroot/mdchroot_0.7.4.bb:do_compile
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
**********************************************
Seemed like ld was not able to find the glibc static library.
Under the tmp/work directory I found these libraries. So, it seems that the glibc static library is there.
*************************************************************
./x86_64-nativesdk-pokysdk-linux/gcc-cross-canadian-powerpc/8.3.0-r0/recipe-sysroot/usr/lib/libc.a ./x86_64-nativesdk-pokysdk-linux/gcc-cross-canadian-powerpc/8.3.0-r0/recipe-sysroot/opt/poky/2.7.1/sysroots/x86_64-pokysdk-linux/usr/lib/libc.a ./x86_64-nativesdk-pokysdk-linux/nativesdk-glibc/2.29-r0/build-x86_64-pokysdk-linux/libc.a ./x86_64-nativesdk-pokysdk-linux/nativesdk-glibc/2.29-r0/image/opt/poky/2.7.1/sysroots/x86_64-pokysdk-linux/usr/lib/libc.a ./x86_64-nativesdk-pokysdk-linux/nativesdk-glibc/2.29-r0/packages-split/nativesdk-glibc-staticdev/opt/poky/2.7.1/sysroots/x86_64-pokysdk-linux/usr/lib/libc.a ./x86_64-nativesdk-pokysdk-linux/nativesdk-glibc/2.29-r0/sysroot-destdir/opt/poky/2.7.1/sysroots/x86_64-pokysdk-linux/usr/lib/libc.a ./x86_64-nativesdk-pokysdk-linux/nativesdk-glibc/2.29-r0/package/opt/poky/2.7.1/sysroots/x86_64-pokysdk-linux/usr/lib/libc.a ./x86_64-nativesdk-pokysdk-linux/gdb-cross-canadian-powerpc/8.2.1-r0/recipe-sysroot/opt/poky/2.7.1/sysroots/x86_64-pokysdk-linux/usr/lib/libc.a
*************************************************************
Any thought what I am missing in the conf/local.conf or in the recipe file?
Thank you in advance.