All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] populate_sdk_base: do not overwrite ld.so.conf in nativesdk
@ 2020-05-19  4:36 Denys Dmytriyenko
  2020-05-19  7:22 ` [OE-core] " Ovidiu Panait
  0 siblings, 1 reply; 2+ messages in thread
From: Denys Dmytriyenko @ 2020-05-19  4:36 UTC (permalink / raw)
  To: openembedded-core; +Cc: Denys Dmytriyenko

From: Denys Dmytriyenko <denys@ti.com>

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 <denys@ti.com>
---
 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
 }
 
 python check_sdk_sysroots() {
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [OE-core] [PATCH] populate_sdk_base: do not overwrite ld.so.conf in nativesdk
  2020-05-19  4:36 [PATCH] populate_sdk_base: do not overwrite ld.so.conf in nativesdk Denys Dmytriyenko
@ 2020-05-19  7:22 ` Ovidiu Panait
  0 siblings, 0 replies; 2+ messages in thread
From: Ovidiu Panait @ 2020-05-19  7:22 UTC (permalink / raw)
  To: Denys Dmytriyenko, openembedded-core; +Cc: Denys Dmytriyenko

[-- Attachment #1: Type: text/plain, Size: 4168 bytes --]

On 19.05.2020 07:36, Denys Dmytriyenko wrote:

> From: Denys Dmytriyenko <denys@ti.com>
>
> 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 <denys@ti.com>
> ---
>   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() {
>
> 

[-- Attachment #2: Type: text/html, Size: 5646 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-19  7:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-19  4:36 [PATCH] populate_sdk_base: do not overwrite ld.so.conf in nativesdk Denys Dmytriyenko
2020-05-19  7:22 ` [OE-core] " Ovidiu Panait

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.