Skip to content

Commit 8ee3d39

Browse files
committed
[dev.regabi] cmd/go: workaround -race issue on ppc64le
The race detector on ppc64le corrupts command-line arguments lists if they contain an empty string, and cmd/go often generates compiler argument lists containing `-D ""`. Since this is equivalent to not specifying the `-D` flag at all, just do that. This allows using a race-detector-enabled cmd/compile on ppc64le. Updates #43883. Change-Id: Ifac5cd9a44932129438b9b0b3ecc6101ad3716b2 Reviewed-on: https://go-review.googlesource.com/c/go/+/286173 Trust: Matthew Dempsky <[email protected]> Run-TryBot: Matthew Dempsky <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]> Reviewed-by: Jay Conrod <[email protected]> TryBot-Result: Go Bot <[email protected]>
1 parent 5a76c3d commit 8ee3d39

File tree

1 file changed

+5
-1
lines changed
  • src/cmd/go/internal/work

1 file changed

+5
-1
lines changed

src/cmd/go/internal/work/gc.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,11 @@ func (gcToolchain) gc(b *Builder, a *Action, archive string, importcfg, embedcfg
129129
}
130130
}
131131

132-
args := []interface{}{cfg.BuildToolexec, base.Tool("compile"), "-o", ofile, "-trimpath", a.trimpath(), gcflags, gcargs, "-D", p.Internal.LocalPrefix}
132+
args := []interface{}{cfg.BuildToolexec, base.Tool("compile"), "-o", ofile, "-trimpath", a.trimpath(), gcflags, gcargs}
133+
if p.Internal.LocalPrefix != "" {
134+
// Workaround #43883.
135+
args = append(args, "-D", p.Internal.LocalPrefix)
136+
}
133137
if importcfg != nil {
134138
if err := b.writeFile(objdir+"importcfg", importcfg); err != nil {
135139
return "", nil, err

0 commit comments

Comments
 (0)