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: 9c2e146ca9
Signed-off-by: Fiona Klute (WIWA) <fiona.klute@gmx.de>
Reviewed-by: Yann E. MORIN <yann.morin@orange.com>
Signed-off-by: Romain Naour <romain.naour@smile.fr>
This commit is contained in:
Fiona Klute (WIWA)
2025-02-05 14:58:25 +01:00
committed by Romain Naour
parent 838a269b87
commit 2578cf368e

View File

@@ -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