Skip to content

Commit

Permalink
Merge pull request #44755 from vvoland/buildflags-nopie-whenrace-2010
Browse files Browse the repository at this point in the history
[20.10 backport] hack/make: Don't add -buildmode=pie with -race
  • Loading branch information
thaJeztah committed Jan 9, 2023
2 parents 6ddb3ba + d645297 commit 208fb1c
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions hack/make/.binary
Original file line number Diff line number Diff line change
Expand Up @@ -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}\""
Expand Down

0 comments on commit 208fb1c

Please sign in to comment.