From db1fef7b2afd12625e3edd90f879e5d05511d1d6 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Sun, 10 Jul 2016 17:51:27 -0700 Subject: [PATCH] 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 --- src/cmd/go/build.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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...) } -- 2.48.1