* [Buildroot] [PATCH] toolchain: follow symlinks in ld.*so.* install helper
@ 2024-12-07 20:36 Sergey Matyukevich
2024-12-07 20:47 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 4+ messages in thread
From: Sergey Matyukevich @ 2024-12-07 20:36 UTC (permalink / raw)
To: buildroot
Cc: Thomas Petazzoni, Giulio Benetti, Romain Naour,
Sergey Matyukevich
Current toolchain install helper fails to setup external toolchains with
merged-usr sysroot. It does not follow lib symlinks when looking for
ld.*.so.* files. As a result builds fail with various linker errors.
Follow symlinks in find tool when installing ld*.so.* linker scripts
from external toolchain directory to staging and target directories.
Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
---
toolchain/helpers.mk | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
index f3fdaaec07..92ad53d064 100644
--- a/toolchain/helpers.mk
+++ b/toolchain/helpers.mk
@@ -140,8 +140,8 @@ copy_toolchain_sysroot = \
$(call simplify_symlink,$$i,$(STAGING_DIR)) ; \
done ; \
fi ; \
- if [[ ! $$(find $(STAGING_DIR)/lib -name 'ld*.so.*' -print -quit) ]]; then \
- find $${ARCH_SYSROOT_DIR}/lib -name 'ld*.so.*' -print0 | xargs -0 -I % cp % $(STAGING_DIR)/lib/; \
+ if [[ ! $$(find -L $(STAGING_DIR)/lib -name 'ld*.so.*' -print -quit) ]]; then \
+ find -L $${ARCH_SYSROOT_DIR}/lib -name 'ld*.so.*' -print0 | xargs -0 -I % cp % $(STAGING_DIR)/lib/; \
fi ; \
if [ `readlink -f $${SYSROOT_DIR}` != `readlink -f $${ARCH_SYSROOT_DIR}` ] ; then \
if [ ! -d $${ARCH_SYSROOT_DIR}/usr/include ] ; then \
--
2.47.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Buildroot] [PATCH] toolchain: follow symlinks in ld.*so.* install helper
2024-12-07 20:36 [Buildroot] [PATCH] toolchain: follow symlinks in ld.*so.* install helper Sergey Matyukevich
@ 2024-12-07 20:47 ` Thomas Petazzoni via buildroot
2024-12-08 20:06 ` Sergey Matyukevich
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-12-07 20:47 UTC (permalink / raw)
To: Sergey Matyukevich; +Cc: buildroot, Giulio Benetti, Romain Naour
Hello Sergey,
On Sat, 7 Dec 2024 23:36:26 +0300
Sergey Matyukevich <geomatsi@gmail.com> wrote:
> Current toolchain install helper fails to setup external toolchains with
> merged-usr sysroot. It does not follow lib symlinks when looking for
> ld.*.so.* files. As a result builds fail with various linker errors.
> Follow symlinks in find tool when installing ld*.so.* linker scripts
> from external toolchain directory to staging and target directories.
>
> Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
Thanks for the patch!
I need to get back to my backlog, but I believe I had investigated some
toolchain issue, and came back to the same patch/change as you.
This regression was introduced by commit
92207bc03f2358b28e0fd2cc3a41e40504b5d3d4 ("toolchain: handle toolchains
with multiple ld*.so.* files").
I am wondering how I got to debug this? Are there some autobuilder
issues?
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Buildroot] [PATCH] toolchain: follow symlinks in ld.*so.* install helper
2024-12-07 20:47 ` Thomas Petazzoni via buildroot
@ 2024-12-08 20:06 ` Sergey Matyukevich
2025-01-21 18:31 ` Sergey Matyukevich
0 siblings, 1 reply; 4+ messages in thread
From: Sergey Matyukevich @ 2024-12-08 20:06 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: buildroot, Giulio Benetti, Romain Naour
Hi Thomas,
On Sat, Dec 07, 2024 at 09:47:32PM +0100, Thomas Petazzoni wrote:
> Hello Sergey,
>
> On Sat, 7 Dec 2024 23:36:26 +0300
> Sergey Matyukevich <geomatsi@gmail.com> wrote:
>
> > Current toolchain install helper fails to setup external toolchains with
> > merged-usr sysroot. It does not follow lib symlinks when looking for
> > ld.*.so.* files. As a result builds fail with various linker errors.
> > Follow symlinks in find tool when installing ld*.so.* linker scripts
> > from external toolchain directory to staging and target directories.
> >
> > Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
>
> Thanks for the patch!
>
> I need to get back to my backlog, but I believe I had investigated some
> toolchain issue, and came back to the same patch/change as you.
>
> This regression was introduced by commit
> 92207bc03f2358b28e0fd2cc3a41e40504b5d3d4 ("toolchain: handle toolchains
> with multiple ld*.so.* files").
>
> I am wondering how I got to debug this? Are there some autobuilder
> issues?
I didn't see any autobuilder issues. Actually I was working with a 3rd
party vendor toolchain. Thanks for finding the commit that introduced
the regression. That commit enabled the use of multilib toolchains with
multiple ld*.so.* files. It turned out that my toolchain had both
properties:
- multilib with multiple ld*.so.* files
- merged-usr property
BTW, I did the following quick test. I baked a Buildroot merged-usr SDK
for aarch64 starting from qemu_aarch64_virt_defconfig. That SDK had a
single ld*.so.* file. Then I rebuilt qemu_aarch64_virt_defconfig image
using that SDK w/o my patch and w/o any issues. So indeed, we have to
use multilib _and_ merged-usr toolchain to trigger this symlink issue.
Should I resend v2 with 'Fixes' tag ?
Regards,
Sergey
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Buildroot] [PATCH] toolchain: follow symlinks in ld.*so.* install helper
2024-12-08 20:06 ` Sergey Matyukevich
@ 2025-01-21 18:31 ` Sergey Matyukevich
0 siblings, 0 replies; 4+ messages in thread
From: Sergey Matyukevich @ 2025-01-21 18:31 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: buildroot, Giulio Benetti, Romain Naour
On Sun, Dec 08, 2024 at 11:06:03PM +0300, Sergey Matyukevich wrote:
> Hi Thomas,
>
> On Sat, Dec 07, 2024 at 09:47:32PM +0100, Thomas Petazzoni wrote:
> > Hello Sergey,
> >
> > On Sat, 7 Dec 2024 23:36:26 +0300
> > Sergey Matyukevich <geomatsi@gmail.com> wrote:
> >
> > > Current toolchain install helper fails to setup external toolchains with
> > > merged-usr sysroot. It does not follow lib symlinks when looking for
> > > ld.*.so.* files. As a result builds fail with various linker errors.
> > > Follow symlinks in find tool when installing ld*.so.* linker scripts
> > > from external toolchain directory to staging and target directories.
> > >
> > > Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
> >
> > Thanks for the patch!
> >
> > I need to get back to my backlog, but I believe I had investigated some
> > toolchain issue, and came back to the same patch/change as you.
> >
> > This regression was introduced by commit
> > 92207bc03f2358b28e0fd2cc3a41e40504b5d3d4 ("toolchain: handle toolchains
> > with multiple ld*.so.* files").
> >
> > I am wondering how I got to debug this? Are there some autobuilder
> > issues?
>
> I didn't see any autobuilder issues. Actually I was working with a 3rd
> party vendor toolchain. Thanks for finding the commit that introduced
> the regression. That commit enabled the use of multilib toolchains with
> multiple ld*.so.* files. It turned out that my toolchain had both
> properties:
> - multilib with multiple ld*.so.* files
> - merged-usr property
>
> BTW, I did the following quick test. I baked a Buildroot merged-usr SDK
> for aarch64 starting from qemu_aarch64_virt_defconfig. That SDK had a
> single ld*.so.* file. Then I rebuilt qemu_aarch64_virt_defconfig image
> using that SDK w/o my patch and w/o any issues. So indeed, we have to
> use multilib _and_ merged-usr toolchain to trigger this symlink issue.
>
> Should I resend v2 with 'Fixes' tag ?
Friendly ping. Any thoughts or comments concerning this fix ?
Regards,
Sergey
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-01-21 18:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-07 20:36 [Buildroot] [PATCH] toolchain: follow symlinks in ld.*so.* install helper Sergey Matyukevich
2024-12-07 20:47 ` Thomas Petazzoni via buildroot
2024-12-08 20:06 ` Sergey Matyukevich
2025-01-21 18:31 ` Sergey Matyukevich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox