Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: <yann.morin@orange.com>
Cc: hello.skyclo@gmail.com, buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH] package/musl: fixup the dynamic loader symlink
Date: Wed, 26 Oct 2022 20:53:12 +0200	[thread overview]
Message-ID: <20221026205312.3f729eb8@windsurf> (raw)
In-Reply-To: <7333_1666791084_635936AC_7333_90_1_20221026133122.GF1657509@tl-lnx-nyma7486>

Hello Yann,

On Wed, 26 Oct 2022 15:31:22 +0200
<yann.morin@orange.com> wrote:

> What about external toolchains?

That's a very good question, which I had not looked into, so I did some
research.

External toolchains are not affected because when we copy the sysroot
from the toolchain into STAGING_DIR, we do this:

        for link in $$(find $(STAGING_DIR) -type l); do \
                target=$$(readlink $${link}) ; \
                if [ "$${target}" == "$${target$(SHARP_SIGN)/}" ] ; then \
                        continue ; \
                fi ; \
                relpath="$(call relpath_prefix,$${target$(SHARP_SIGN)/})" ; \
                echo "Fixing symlink $${link} from $${target} to $${relpath}$${target$(SHARP_SIGN)/}" ; \
                ln -sf $${relpath}$${target$(SHARP_SIGN)/} $${link} ; \
        done ; \

(from toolchain/helpers.mk:copy_toolchain_sysroot)

This causes this to happen:

>>> toolchain-external-bootlin 2021.11-1 Copying external toolchain sysroot to staging...
Fixing symlink /home/thomas/projets/buildroot/output/host/x86_64-buildroot-linux-musl/sysroot/lib/ld-musl-x86_64.so.1 from /lib/libc.so to ../lib/libc.so

So in the external toolchain, even if the symlink is broken, it gets
fixed when we import the toolchain into STAGING_DIR.

(Note: the external toolchain used here is a Bootlin toolchain,
produced by Buildroot, but without the musl.mk fix, so it does have the
bogus ld-musl-x86-64.so.1 -> /lib/libc.so link, but that gets fixed
when we import the toolchain, as described above)

Does that this seem like a good enough answer for the external
toolchain case? If so, I can submit a v2 with an amended commit log.

Thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2022-10-26 18:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-26 12:58 [Buildroot] [PATCH] package/musl: fixup the dynamic loader symlink Thomas Petazzoni via buildroot
2022-10-26 13:31 ` yann.morin
2022-10-26 18:53   ` Thomas Petazzoni via buildroot [this message]
2022-10-27  5:50     ` yann.morin
2022-10-30 19:38 ` Yann E. MORIN
2022-11-13 15:10 ` Peter Korsgaard

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=20221026205312.3f729eb8@windsurf \
    --to=buildroot@buildroot.org \
    --cc=hello.skyclo@gmail.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=yann.morin@orange.com \
    /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