From d000f12fccf06d4feabc2a5d665c10d20d09bab5 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 3 Sep 2024 10:12:29 +0200 Subject: [PATCH] hack/make/.binary: enable pie mode on windows/arm64 pie-mode is supported for windows/arm64 since https://go.dev/cl/452415, which is part of go1.20. Also update link to Go source for pie-mode support to match the location for current versions of Go because the package was moved in https://go.dev/cl/438475. Signed-off-by: Sebastiaan van Stijn --- hack/make/.binary | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hack/make/.binary b/hack/make/.binary index 37c73d9390..ad420a609e 100644 --- a/hack/make/.binary +++ b/hack/make/.binary @@ -37,13 +37,14 @@ source "${MAKEDIR}/.go-autogen" fi fi - # -buildmode=pie is not supported on Windows arm64 and Linux mips*, ppc64be - # https://github.com/golang/go/blob/go1.19.4/src/cmd/internal/sys/supported.go#L125-L132 if ! [ "$DOCKER_STATIC" = "1" ]; then # -buildmode=pie not supported when -race is enabled if [[ " $BUILDFLAGS " != *" -race "* ]]; then case "$(go env GOOS)/$(go env GOARCH)" in - windows/arm64 | linux/mips* | linux/ppc64) ;; + linux/mips* | linux/ppc64) + # -buildmode=pie is not supported on Linux mips*, ppc64be + # https://github.com/golang/go/blob/go1.23.0/src/internal/platform/supported.go#L189-L197 + ;; *) BUILDFLAGS+=("-buildmode=pie") ;;