]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: for -msan build runtime/cgo with -fsanitize=memory
authorIan Lance Taylor <iant@golang.org>
Mon, 11 Jul 2016 00:51:27 +0000 (17:51 -0700)
committerIan Lance Taylor <iant@golang.org>
Mon, 29 Aug 2016 22:49:16 +0000 (22:49 +0000)
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 <iant@golang.org>
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/go/build.go

index 088164ba68616fb733b3718391e3207a69e3c66a..e19cc5d38bb6dbe5be7bed5c306c842f16ce3df7 100644 (file)
@@ -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...)
        }