On 19.05.2020 07:36, Denys Dmytriyenko wrote:
From: Denys Dmytriyenko <[email protected]>
Commit 7ec84a463ad4c45aee9cd2cbc75b43e5aab5cd18 has moved creation of ld.so.conf
from buildtools-tarball.bb to create_sdk_files() in populate_sdk_base.bbclass.
But since create_sdk_files() is an SDK_POSTPROCESS_COMMAND, creating ld.so.conf
can potentially overwrite existing file already provided by a nativesdk package.
Use append instead to avoid overwriting existing file.
Signed-off-by: Denys Dmytriyenko <[email protected]>
---
meta/classes/populate_sdk_base.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/classes/populate_sdk_base.bbclass
b/meta/classes/populate_sdk_base.bbclass
index 990505e..83c3448 100644
--- a/meta/classes/populate_sdk_base.bbclass
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -189,7 +189,7 @@ fakeroot create_sdk_files() {
mkdir -p ${SDK_OUTPUT}/${SDKPATHNATIVE}${sysconfdir}/
echo '${SDKPATHNATIVE}${libdir_nativesdk}
${SDKPATHNATIVE}${base_libdir_nativesdk}
-include /etc/ld.so.conf' >
${SDK_OUTPUT}/${SDKPATHNATIVE}${sysconfdir}/ld.so.conf
+include /etc/ld.so.conf' >>
${SDK_OUTPUT}/${SDKPATHNATIVE}${sysconfdir}/ld.so.conf
}
Hi Denys,
With this change, in my testing (Ubuntu 18.04 server), nativesdk-gcc
would still try to link with host libraries first rather than nativesdk
ones, basically reverting the original intent of commit
7ec84a463ad4c45aee9cd2cbc75b43e5aab5cd18:
local.conf:
KERNEL_DEV_HOST_PKGS = "\
nativesdk-openssl-dev \
nativesdk-libelf \
nativesdk-elfutils-dev \
nativesdk-ncurses-terminfo-base \
nativesdk-chrpath \
nativesdk-tar \
nativesdk-git \
nativesdk-pigz \
nativesdk-make \
nativesdk-wget \
nativesdk-ca-certificates \
nativesdk-texinfo \
nativesdk-libnss-nis \
nativesdk-rpcsvc-proto \
nativesdk-patch \
nativesdk-automake \
nativesdk-autoconf \
nativesdk-binutils \
nativesdk-binutils-symlinks \
nativesdk-cpp \
nativesdk-cpp-symlinks \
nativesdk-gcc \
nativesdk-gcc-symlinks \
nativesdk-g++ \
nativesdk-g++-symlinks \
nativesdk-gettext \
nativesdk-libatomic \
nativesdk-libgcc \
nativesdk-libstdc++ \
nativesdk-libstdc++-dev \
nativesdk-libtool \
nativesdk-pkgconfig \
nativesdk-glibc-utils \
nativesdk-libxcrypt-dev \
"
KERNEL_DEV_HOST_PKGS_pn-uninative-tarball = ""
KERNEL_DEV_HOST_PKGS_pn-buildtools-tarball = ""
TOOLCHAIN_HOST_TASK_append = " ${KERNEL_DEV_HOST_PKGS}"
bitbake -c populate_sdk core-image-minimal
<extract and source sdk>
$ cat ld.so.conf
include /etc/ld.so.conf.d/*.conf
/buildarea/raid0/ovidiu/Builds/Yocto/yocto-latest/poky/build/tmp/deploy/sdk/sdk/sysroots/x86_64-pokysdk-linux/usr/lib
/buildarea/raid0/ovidiu/Builds/Yocto/yocto-latest/poky/build/tmp/deploy/sdk/sdk/sysroots/x86_64-pokysdk-linux/lib
include /etc/ld.so.conf
$ cat test.c
int main()
{
return 0;
}
$ gcc -o test test.c -lcrypto
/buildarea/raid0/ovidiu/Builds/Yocto/yocto-latest/poky/build/tmp/deploy/sdk/sdk/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/10.1.0/../../../../x86_64-pokysdk-linux/bin/ld:
/lib/x86_64-linux-gnu/libpthread.so.0: undefined reference to
`__libc_vfork@GLIBC_PRIVATE'
collect2: error: ld returned 1 exit status
Before this change:
$ gcc -o test test.c -lcrypto
$ echo $?
0
Also, it seems that the scenario in which the SDK provides its own
/etc/ld.so.conf and other nativesdk packages append to it did not
operate correctly even before commit
7ec84a463ad4c45aee9cd2cbc75b43e5aab5cd18, because host paths would be
appended instead of SDK paths.
Maybe we should try in create_sdk_files to prepend all existing paths
from /etc/ld.so.conf with ${SDK_OUTPUT}/${SDKPATHNATIVE} to solve this
overwrite problem?
Ovidiu
python check_sdk_sysroots() {
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#138454):
https://lists.openembedded.org/g/openembedded-core/message/138454
Mute This Topic: https://lists.openembedded.org/mt/74319242/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-