hack/make: Don't add -buildmode=pie with -race
Make it possible to add `-race` to the BUILDFLAGS without making the build fail with error: "-buildmode=pie not supported when -race is enabled" Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
parent
fcb52454ac
commit
bbe6e9e8d1
1 changed files with 9 additions and 6 deletions
|
@ -74,12 +74,15 @@ source "${MAKEDIR}/.go-autogen"
|
|||
# -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
|
||||
case "$(go env GOOS)/$(go env GOARCH)" in
|
||||
windows/arm64 | linux/mips* | linux/ppc64) ;;
|
||||
*)
|
||||
BUILDFLAGS+=("-buildmode=pie")
|
||||
;;
|
||||
esac
|
||||
# -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) ;;
|
||||
*)
|
||||
BUILDFLAGS+=("-buildmode=pie")
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
|
||||
# only necessary for non-sandboxed invocation where TARGETPLATFORM is empty
|
||||
|
|
Loading…
Reference in a new issue