From 7ec84a463ad4c45aee9cd2cbc75b43e5aab5cd18 Mon Sep 17 00:00:00 2001 From: Ovidiu Panait Date: Tue, 28 Apr 2020 15:57:46 +0300 Subject: populate_sdk_base: Add ld.so.conf for nativesdk-binutils 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 Signed-off-by: Richard Purdie --- meta/classes/populate_sdk_base.bbclass | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'meta/classes/populate_sdk_base.bbclass') diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass index ef0d8bef58..6a1ebc8c02 100644 --- a/meta/classes/populate_sdk_base.bbclass +++ b/meta/classes/populate_sdk_base.bbclass @@ -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() { -- cgit 1.2.3-korg