浏览代码

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) <fiona.klute@gmx.de>
Reviewed-by: Yann E. MORIN <yann.morin@orange.com>
Signed-off-by: Romain Naour <romain.naour@smile.fr>
Fiona Klute (WIWA) 6 月之前
父节点
当前提交
2578cf368e
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      package/containerd/containerd.mk

+ 6 - 0
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