From 2328fbef88a678b3386d356ba33721cc49214ac2 Mon Sep 17 00:00:00 2001 From: Valentin David Date: Fri, 23 Aug 2024 14:30:16 +0200 Subject: [PATCH] snapcraft.yaml: force pie buildmode for go (#14411) On some architectures, like RISC-V, go decides to not use it. But this is required by some kernels. --- build-aux/snap/snapcraft.yaml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/build-aux/snap/snapcraft.yaml b/build-aux/snap/snapcraft.yaml index 23cbb3262da..f63207e41c1 100644 --- a/build-aux/snap/snapcraft.yaml +++ b/build-aux/snap/snapcraft.yaml @@ -287,7 +287,16 @@ parts: ;; *) export CGO_ENABLED=1 - GO_LD_FLAGS=() + case "${CRAFT_ARCH_BUILD_FOR}" in + armhf) + # https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1822738 + BUILDMODE=() + ;; + *) + BUILDMODE=(-buildmode=pie) + ;; + esac + GO_LD_FLAGS=("${BUILDMODE[@]}") unset CHECK_STATIC ;; esac