Merge pull request #44755 from vvoland/buildflags-nopie-whenrace-2010

[20.10 backport] hack/make: Don't add -buildmode=pie with -race
This commit is contained in:
Sebastiaan van Stijn 2023-01-09 13:30:14 +01:00 committed by GitHub
commit 208fb1ca7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -70,14 +70,17 @@ hash_files() {
esac
fi
# -buildmode=pie is not supported on Windows and Linux on mips and riscv64.
case "$(go env GOOS)/$(go env GOARCH)" in
windows/* | linux/mips* | linux/riscv*) ;;
# -buildmode=pie not supported when -race is enabled
if [[ " $BUILDFLAGS " != *" -race "* ]]; then
# -buildmode=pie is not supported on Windows and Linux on mips and riscv64.
case "$(go env GOOS)/$(go env GOARCH)" in
windows/* | linux/mips* | linux/riscv*) ;;
*)
BUILDFLAGS+=("-buildmode=pie")
;;
esac
*)
BUILDFLAGS+=("-buildmode=pie")
;;
esac
fi
echo "Building: $DEST/$BINARY_FULLNAME"
echo "GOOS=\"${GOOS}\" GOARCH=\"${GOARCH}\" GOARM=\"${GOARM}\""