]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: give useful error when msan isn't supported
authorDhananjay Nakrani <dhananjaynakrani@gmail.com>
Sat, 3 Dec 2016 05:17:29 +0000 (21:17 -0800)
committerBrad Fitzpatrick <bradfitz@golang.org>
Sun, 4 Dec 2016 18:38:47 +0000 (18:38 +0000)
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>

src/cmd/go/build.go

index 215c5ff6e37b6e180792dbfeb8c62206e999a963..e053b28c989272063e81cd95ebec9c958eb1d6a3 100644 (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)