]> code.ossystems Code Review - openembedded-core.git/commitdiff
populate_sdk_base: Add ld.so.conf for nativesdk-binutils
authorOvidiu Panait <ovidiu.panait@windriver.com>
Tue, 28 Apr 2020 12:57:46 +0000 (15:57 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 29 Apr 2020 14:00:36 +0000 (15:00 +0100)
Extend the functionality provided by commit [1] to the SDK as well. This way we
can make sure that nativesdk-binutils finds SDK libraries first rather than
host ones.

This is useful for example when trying to build the linux kernel using
nativesdk-gcc. This scenario currently fails because it tries to link to host
libraries rather than SDK host ones:

make x86_64_defconfig
make bzImage
...
error: Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel
Makefile:1101: recipe for target 'prepare-objtool' failed
make: *** [prepare-objtool] Error 1
....
/../../../../x86_64-wrlinuxsdk-linux/bin/ld: /lib/x86_64-linux-gnu/libpthread.so.0: undefined reference to `__libc_vfork@GLIBC_PRIVATE'
...

[1] 15049c610b [buildtools-tarball: Add an ld.so.conf for nativesdk-binutils]

Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/populate_sdk_base.bbclass
meta/recipes-core/meta/buildtools-tarball.bb

index ef0d8bef5856b9c4a567446386699450bc74f370..6a1ebc8c02e86a4695f71dd17d790e6a74750766 100644 (file)
@@ -185,6 +185,11 @@ fakeroot create_sdk_files() {
        # Escape special characters like '+' and '.' in the SDKPATH
        escaped_sdkpath=$(echo ${SDKPATH} |sed -e "s:[\+\.]:\\\\\\\\\0:g")
        sed -i -e "s:##DEFAULT_INSTALL_DIR##:$escaped_sdkpath:" ${SDK_OUTPUT}/${SDKPATH}/relocate_sdk.py
+
+       mkdir -p ${SDK_OUTPUT}/${SDKPATHNATIVE}${sysconfdir}/
+       echo '${SDKPATHNATIVE}${libdir}
+${SDKPATHNATIVE}${base_libdir}
+include /etc/ld.so.conf' > ${SDK_OUTPUT}/${SDKPATHNATIVE}${sysconfdir}/ld.so.conf
 }
 
 python check_sdk_sysroots() {
index 977b6a5e1dcbdb3491b3f6746a275dec8c04e712..c49802eef8663cc08980e7552a7fca2344ebcd50 100644 (file)
@@ -76,10 +76,6 @@ create_sdk_files_append () {
        echo 'export GIT_SSL_CAINFO="${SDKPATHNATIVE}${sysconfdir}/ssl/certs/ca-certificates.crt"' >>$script
        echo 'export OPENSSL_CONF="${SDKPATHNATIVE}${sysconfdir}/ssl/openssl.cnf"' >>$script
 
-       mkdir -p ${SDK_OUTPUT}/${SDKPATHNATIVE}${sysconfdir}/
-       echo '${SDKPATHNATIVE}${libdir}
-${SDKPATHNATIVE}${base_libdir}
-include /etc/ld.so.conf' > ${SDK_OUTPUT}/${SDKPATHNATIVE}${sysconfdir}/ld.so.conf
        if [ "${SDKMACHINE}" = "i686" ]; then
                echo 'export NO32LIBS="0"' >>$script
                echo 'echo "$BB_ENV_EXTRAWHITE" | grep -q "NO32LIBS"' >>$script