From: Fiona Klute via buildroot <buildroot@buildroot.org>
To: yann.morin@orange.com
Cc: Thomas Perale <thomas.perale@mind.be>,
Christian Stewart <christian@aperture.us>,
buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/1] package/containerd: fix build with toolchain without Gold linker
Date: Tue, 4 Feb 2025 21:29:59 +0100 [thread overview]
Message-ID: <b99b664a-c050-43f9-b38e-b3467c47e123@gmx.de> (raw)
In-Reply-To: <d8942b7b-a7f2-49ef-b9c2-f0c3d46c6b17@gmx.de>
[-- Attachment #1: Type: text/plain, Size: 2434 bytes --]
Am 04.02.25 um 19:36 schrieb Fiona Klute:
> Hi Yann!
>
> Am 04.02.25 um 15:47 schrieb yann.morin@orange.com:
>> Fiona, All,
>>
>> On 2025-02-04 15:32 +0100, Fiona Klute spake thusly:
>>> From: "Fiona Klute (WIWA)" <fiona.klute@gmx.de>
>> [--SNIP--]
>>> Additionally disable PIE on musl to fix "read-only segment has dynamic
>>> relocations" errors during linking [2].
>> [--SNIP--]
>>> +ifeq ($(BR2_aarch64),y)
>>> +# Go forces use of the Gold linker on aarch64 due to a bug in BFD that
>>> +# is fixed in Binutils >= 2.41 (so all versions provided by
>>> +# Buildroot). Forcing Gold will break with toolchains that don't
>>> +# provide it, so override the flag and use BFD.
>>> +# See: https://github.com/golang/go/issues/22040
>>> +CONTAINERD_EXTLDFLAGS += -fuse-ld=bfd
>>> +ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
>>> +# Go exe build with PIE doesn't work with musl.
>>> +# See: https://github.com/golang/go/issues/17847
>>> +CONTAINERD_EXTLDFLAGS += -Wl,--no-pie
>>> +endif
>>> +endif
>>
>> Is the PIE issue really only hapenning on Aarch64? The upstream issue
>> 17847 does not make it that obvious, but at least mips64 is said to have
>> the issue as well, and someone even mentioned amd64 (aka x86_64).
>>
>> I.e. don't we need the musl workaround out of the aarch64 condition?
> I'm not sure. The Go code has a check if PIE works with the given
> compiler & linker and disables it otherwise [1], and I didn't run into
> this problem when patching the forced --fuse-ld=gold out of Go, so I
> *assume* the --fuse-ld=bfd override breaks that check in some way and we
> don't need --no-pie it if we don't override the linker.
>
> It definitely would be good to actually test that. I'll see if I can fit
> a build in, though I'd appreciate if someone who can actually test the
> result gives it a try. Note that the bug will only show with a toolchain
> that builds PIE by default.
Update: I've tested it now with a build for x86_64 Qemu (config based on
configs/qemu_x86_64_defconfig attached). Build passes and works
(alpine:latest runs), except not with the default Qemu command line from
board/qemu/x86_64/readme.txt: I had to add "-cpu max", with the default
Docker refuses to start due to missing CPU features.
On mips64 I can't enable Docker due to
BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS=n.
Conclusion: I think the patch is good as-is. :-)
Best regards,
Fiona
[-- Attachment #2: qemu_x86_64_docker.config --]
[-- Type: text/plain, Size: 871 bytes --]
BR2_x86_64=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_X86_64_MUSL_STABLE=y
BR2_DL_DIR="$(HOME)/.buildroot/dl"
BR2_GLOBAL_PATCH_DIR="board/qemu/patches"
BR2_DOWNLOAD_FORCE_CHECK_HASHES=y
BR2_SYSTEM_DHCP="eth0"
BR2_ROOTFS_POST_BUILD_SCRIPT="board/qemu/x86_64/post-build.sh"
BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/post-image.sh"
BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.9"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/x86_64/linux.config"
BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF=y
BR2_PACKAGE_CA_CERTIFICATES=y
BR2_PACKAGE_DOCKER_CLI=y
BR2_PACKAGE_DOCKER_ENGINE=y
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_SIZE="256M"
# BR2_TARGET_ROOTFS_TAR is not set
BR2_PACKAGE_HOST_QEMU=y
BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE=y
[-- Attachment #3: Type: text/plain, Size: 150 bytes --]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2025-02-04 20:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-04 14:32 [Buildroot] [PATCH 1/1] package/containerd: fix build with toolchain without Gold linker Fiona Klute via buildroot
2025-02-04 14:47 ` yann.morin
2025-02-04 18:36 ` Fiona Klute via buildroot
2025-02-04 20:29 ` Fiona Klute via buildroot [this message]
2025-02-04 21:23 ` Christian Stewart via buildroot
2025-02-05 8:03 ` Arnout Vandecappelle via buildroot
2025-02-05 8:29 ` yann.morin
2025-02-05 9:20 ` Christian Stewart via buildroot
2025-02-05 9:41 ` yann.morin
2025-02-05 9:42 ` Arnout Vandecappelle via buildroot
2025-02-05 10:24 ` Fiona Klute via buildroot
2025-02-05 10:33 ` Arnout Vandecappelle via buildroot
2025-02-05 11:40 ` Fiona Klute via buildroot
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=b99b664a-c050-43f9-b38e-b3467c47e123@gmx.de \
--to=buildroot@buildroot.org \
--cc=christian@aperture.us \
--cc=fiona.klute@gmx.de \
--cc=thomas.perale@mind.be \
--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 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.