1
0
mirror of https://github.com/golang/go synced 2024-11-23 16:10:05 -07:00

cmd/go: give useful error when msan isn't supported

Fixes #18180.

Change-Id: I7006fe6cf08139e5aaaf35412b962a4e82109f59
Reviewed-on: https://go-review.googlesource.com/33898
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Dhananjay Nakrani 2016-12-02 21:17:29 -08:00 committed by Brad Fitzpatrick
parent d54b60a2b2
commit af67f7de3f

View File

@ -3776,6 +3776,10 @@ func instrumentInit() {
fmt.Fprintf(os.Stderr, "go %s: may not use -race and -msan simultaneously\n", flag.Args()[0])
os.Exit(2)
}
if buildMSan && (goos != "linux" || goarch != "amd64") {
fmt.Fprintf(os.Stderr, "-msan is not supported on %s/%s\n", goos, goarch)
os.Exit(2)
}
if goarch != "amd64" || goos != "linux" && goos != "freebsd" && goos != "darwin" && goos != "windows" {
fmt.Fprintf(os.Stderr, "go %s: -race and -msan are only supported on linux/amd64, freebsd/amd64, darwin/amd64 and windows/amd64\n", flag.Args()[0])
os.Exit(2)