1
0
mirror of https://github.com/golang/go synced 2024-09-30 02:24:43 -06:00

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 <iant@golang.org>
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Ian Lance Taylor 2016-07-10 17:51:27 -07:00
parent bd9aa9811d
commit db1fef7b2a

View 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...)
}