Skip to content

Commit 2a12957

Browse files
Sergei Shirshanovfmeum
Sergei Shirshanov
authored andcommitted
Build stdlib with msan support
1 parent 9b4c2ab commit 2a12957

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

go/private/actions/stdlib.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ def _build_stdlib(go):
133133
args.add_all("-out", [pkg], map_each = _dirname, expand_directories = False)
134134
if go.mode.race:
135135
args.add("-race")
136+
if go.mode.msan:
137+
args.add("-msan")
136138
args.add("-package", "std")
137139
if not go.mode.pure:
138140
args.add("-package", "runtime/cgo")

go/tools/builders/stdlib.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ func stdlib(args []string) error {
3131
goenv := envFlags(flags)
3232
out := flags.String("out", "", "Path to output go root")
3333
race := flags.Bool("race", false, "Build in race mode")
34+
msan := flags.Bool("msan", false, "Build in msan mode")
3435
shared := flags.Bool("shared", false, "Build in shared mode")
3536
dynlink := flags.Bool("dynlink", false, "Build in dynlink mode")
3637
pgoprofile := flags.String("pgoprofile", "", "Build with pgo using the given pprof file")
@@ -130,6 +131,9 @@ You may need to use the flags --cpu=x64_windows --compiler=mingw-gcc.`)
130131
if *race {
131132
installArgs = append(installArgs, "-race")
132133
}
134+
if *msan {
135+
installArgs = append(installArgs, "-msan")
136+
}
133137
if *pgoprofile != "" {
134138
gcflags = append(gcflags, "-pgoprofile=" + abs(*pgoprofile))
135139
}

0 commit comments

Comments
 (0)