From: Ian Lance Taylor Date: Mon, 11 Jul 2016 00:51:27 +0000 (-0700) Subject: cmd/go: for -msan build runtime/cgo with -fsanitize=memory X-Git-Tag: go1.8beta1~1586 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=db1fef7b2afd12625e3edd90f879e5d05511d1d6;p=gostls13.git cmd/go: for -msan build runtime/cgo with -fsanitize=memory The go tool used to avoid passing -fsanitize=memory when building runtime/cgo. That was originally to avoid an msan error, but that error was fixed anyhow for issue #13815. And building runtime/cgo with -fsanitize=memory corrects the handling of the context traceback function when the traceback function itself is built with -fsanitize=memory. Change-Id: I4bf5c3d21de6b2eb540600435ae47f5820d17464 Reviewed-on: https://go-review.googlesource.com/24855 Run-TryBot: Ian Lance Taylor Reviewed-by: Joe Tsai TryBot-Result: Gobot Gobot --- diff --git a/src/cmd/go/build.go b/src/cmd/go/build.go index 088164ba68..e19cc5d38b 100644 --- a/src/cmd/go/build.go +++ b/src/cmd/go/build.go @@ -3195,7 +3195,7 @@ func (b *builder) cgo(p *Package, cgoExe, obj string, pcCFLAGS, pcLDFLAGS, cgofi } } - if buildMSan && p.ImportPath != "runtime/cgo" { + if buildMSan { cgoCFLAGS = append([]string{"-fsanitize=memory"}, cgoCFLAGS...) cgoLDFLAGS = append([]string{"-fsanitize=memory"}, cgoLDFLAGS...) }