Browse code

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 <github@gone.nl>

Sebastiaan van Stijn authored on 2024/09/03 17:12:29
Showing 1 changed files
... ...
@@ -37,13 +37,14 @@ source "${MAKEDIR}/.go-autogen"
37 37
 		fi
38 38
 	fi
39 39
 
40
-	# -buildmode=pie is not supported on Windows arm64 and Linux mips*, ppc64be
41
-	# https://github.com/golang/go/blob/go1.19.4/src/cmd/internal/sys/supported.go#L125-L132
42 40
 	if ! [ "$DOCKER_STATIC" = "1" ]; then
43 41
 		# -buildmode=pie not supported when -race is enabled
44 42
 		if [[ " $BUILDFLAGS " != *" -race "* ]]; then
45 43
 			case "$(go env GOOS)/$(go env GOARCH)" in
46
-				windows/arm64 | linux/mips* | linux/ppc64) ;;
44
+				linux/mips* | linux/ppc64)
45
+					# -buildmode=pie is not supported on Linux mips*, ppc64be
46
+					# https://github.com/golang/go/blob/go1.23.0/src/internal/platform/supported.go#L189-L197
47
+					;;
47 48
 				*)
48 49
 					BUILDFLAGS+=("-buildmode=pie")
49 50
 					;;