Skip to content

Commit

Permalink
snapcraft.yaml: force pie buildmode for go (#14411)
Browse files Browse the repository at this point in the history
On some architectures, like RISC-V, go decides to not use it. But this
is required by some kernels.
  • Loading branch information
valentindavid authored Aug 23, 2024
1 parent c660e25 commit 2328fbe
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion build-aux/snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2328fbe

Please sign in to comment.