From 2578cf368e604211bacaef27738ea96dcaba7572 Mon Sep 17 00:00:00 2001 From: "Fiona Klute (WIWA)" Date: Wed, 5 Feb 2025 14:58:25 +0100 Subject: [PATCH] package/containerd: use --no-pie on musl Disable PIE on musl to fix "read-only segment has dynamic relocations" errors during linking [1] that appeared after major version bump to v2. [1] https://github.com/golang/go/issues/17847 Fixes: 9c2e146ca9a21f0de3c97981113a57c58c3a5bd5 Signed-off-by: Fiona Klute (WIWA) Reviewed-by: Yann E. MORIN Signed-off-by: Romain Naour --- package/containerd/containerd.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/package/containerd/containerd.mk b/package/containerd/containerd.mk index ee07c22495..1f70a26ebf 100644 --- a/package/containerd/containerd.mk +++ b/package/containerd/containerd.mk @@ -49,6 +49,12 @@ ifneq ($(BR2_PACKAGE_CONTAINERD_CRI),y) CONTAINERD_TAGS += no_cri endif +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 + define CONTAINERD_INSTALL_INIT_SYSTEMD $(INSTALL) -D -m 0644 $(@D)/containerd.service \ $(TARGET_DIR)/usr/lib/systemd/system/containerd.service