Note that before Go 1.5 this option took two separate arguments.
-a
Disassemble output.
+ -asan
+ Link with C/C++ address sanitizer support.
-buildid id
Record id as Go toolchain build id.
-buildmode mode
return true, "msan"
}
+ if *flagAsan {
+ return true, "asan"
+ }
+
// Internally linking cgo is incomplete on some architectures.
// https://golang.org/issue/14449
if iscgo && ctxt.Arch.InFamily(sys.MIPS64, sys.MIPS, sys.RISCV64) {
} else if *flagMsan {
suffixsep = "_"
suffix = "msan"
+ } else if *flagAsan {
+ suffixsep = "_"
+ suffix = "asan"
}
Lflag(ctxt, filepath.Join(buildcfg.GOROOT, "pkg", fmt.Sprintf("%s_%s%s%s", buildcfg.GOOS, buildcfg.GOARCH, suffixsep, suffix)))
if *flagMsan {
loadinternal(ctxt, "runtime/msan")
}
+ if *flagAsan {
+ loadinternal(ctxt, "runtime/asan")
+ }
loadinternal(ctxt, "runtime")
for ; i < len(ctxt.Library); i++ {
lib := ctxt.Library[i]
"runtime/cgo",
"runtime/race",
"runtime/msan",
+ "runtime/asan",
}
func ldhostobj(ld func(*Link, *bio.Reader, string, int64, string), headType objabi.HeadType, f *bio.Reader, pkg string, length int64, pn string, file string) *Hostobj {
flagDumpDep = flag.Bool("dumpdep", false, "dump symbol dependency graph")
flagRace = flag.Bool("race", false, "enable race detector")
flagMsan = flag.Bool("msan", false, "enable MSan interface")
+ flagAsan = flag.Bool("asan", false, "enable ASan interface")
flagAslr = flag.Bool("aslr", true, "enable ASLR for buildmode=c-shared on windows")
flagFieldTrack = flag.String("k", "", "set field tracking `symbol`")