From: "Anatol Belski" <anbelski@linux.microsoft.com>
To: Richard Purdie <richard.purdie@linuxfoundation.org>,
openembedded-core <openembedded-core@lists.openembedded.org>
Cc: randy.macleod@windriver.com
Subject: Re: [OE-core] Current native SDK glibc compat
Date: Wed, 24 Feb 2021 21:16:20 +0100 [thread overview]
Message-ID: <ce2c3ea0-891b-8c7d-e89a-590fcd7ab12c@linux.microsoft.com> (raw)
In-Reply-To: <e4561a7e8c89fe26dd593b0412e16be67665baff.camel@linuxfoundation.org>
On 2/24/2021 5:49 PM, Richard Purdie wrote:
> On Wed, 2021-02-24 at 13:56 +0100, Anatol Belski wrote:
>> On 2/24/2021 1:32 PM, Richard Purdie wrote:
>>> Hi,
>>>
>>> On Wed, 2021-02-24 at 12:40 +0100, Anatol Belski wrote:
>>>> the current master build seems to be broken with symbols unavailable
>>>> from the host glibc. The following is to see on the SDK built and
>>>> installed on the same host Ubuntu 18.04.5 having glibc 2.27:
>>>>
>>>> $ . /tmp/poky-sdk-master-00/environment-setup-core2-64-poky-linux
>>>>
>>>> $ ldd $(which $CC)
>>>> /tmp/poky-sdk-master-00/sysroots/x86_64-pokysdk-linux/usr/bin/x86_64-poky-linux/x86_64-poky-linux-gcc:
>>>> /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found
>>> We change the loader path inside our SDK binaries so you can't trust the
>>> output from ldd, it will find a different result to what you'd see
>>> when you run the binary.
>>>
>>> What issue are you seeing trying to run these?
>> Initially it was sighted here appearing when a binary is actually invoked:
>>
>> https://github.com/meta-rust/meta-rust/pull/313#issuecomment-782784056
>>
>> I went digging to see similar cases.
>>
>>
>> Regarding the loader path, are you referring to this?
>>
>> $ chrpath $(which $CC)
>> /tmp/poky-sdk-master-00/sysroots/x86_64-pokysdk-linux/usr/bin/x86_64-poky-linux/x86_64-poky-linux-gcc:
>> RPATH=$ORIGIN/../../lib
> No, I mean the dynamic loader pointer.
>
> $ tmp/sysroots-uninative/x86_64-linux/usr/bin/patchelf-uninative python3-native/python3.9 --print-interpreter
> [...]tmp/sysroots-uninative/x86_64-linux/lib/ld-linux-x86-64.so.2
>
> Above I'm showing that a native binary in the build (python3-native)
> has the interpreter (dynamic loader) set to our uninative ld.so.
> The SDK is similar.
>
>> As the binary where the issue was sighted has this
>>
>> $ chrpath $(which cargo)
>> /tmp/rust-sdk-deploy-18/sysroots/x86_64-pokysdk-linux/usr/bin/cargo:
>> RUNPATH=$ORIGIN/../lib
>>
>>
>> but then, the DSOs have no rpath set, eg.
>>
>> $ chrpath
>> /tmp/rust-sdk-deploy-18/sysroots/x86_64-pokysdk-linux/usr/bin/../lib/libcrypto.so.1.1
>> /tmp/rust-sdk-deploy-18/sysroots/x86_64-pokysdk-linux/usr/bin/../lib/libcrypto.so.1.1:
>> no rpath or runpath tag found.
>>
>>
>> so it might lead to the interferrence with the host. Does it perhaps
>> need both $ORIGIN/../../lib and $ORIGIN/../lib if binaries are in /usr ?
> Our dynamic loader knows how to use the specific sysroot and then
> fall back to /usr and /lib.
Thanks a lot for explaining this.
Getting back to the initial case led to the question, i'm now able to
check what is the correct dynamic loader:
$ tmp/sysroots-uninative/x86_64-linux/usr/bin/patchelf-uninative
/tmp/rust-sdk-deploy-18/sysroots/x86_64-pokysdk-linux/usr/bin/cargo
--print-interpreter
/tmp/rust-sdk-deploy-18/sysroots/x86_64-pokysdk-linux/lib/ld-linux-x86-64.so.2
and also could use --print-needed which would be similar to "readelf -d
", but it'd be still not possible to check things at the runtime? OFC
knowing what i know now, it's possible to locate the DSO and check
symbols like this:
$ x86_64-poky-linux-objdump -T
./sysroots/x86_64-pokysdk-linux/lib/libc.so.6 | grep GLIBC_2.33
just seems the catch points are quite subtle :) Perhaps there could be a
recommendation on a good way validating the binaries in the SDK HOST part?
Thanks
Anatol
next prev parent reply other threads:[~2021-02-24 20:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-24 11:40 Current native SDK glibc compat Anatol Belski
2021-02-24 12:32 ` [OE-core] " Richard Purdie
2021-02-24 12:56 ` Anatol Belski
2021-02-24 16:49 ` Richard Purdie
2021-02-24 20:16 ` Anatol Belski [this message]
2021-02-24 23:57 ` Richard Purdie
2021-02-25 0:23 ` Randy MacLeod
2021-02-25 19:22 ` Anatol Belski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ce2c3ea0-891b-8c7d-e89a-590fcd7ab12c@linux.microsoft.com \
--to=anbelski@linux.microsoft.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=randy.macleod@windriver.com \
--cc=richard.purdie@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox