Commit 4ae3835a authored by Clément Chigot's avatar Clément Chigot Committed by Ian Lance Taylor

cmd/go: silence ar with D flag failures

The first call of ar must not show its output in order to avoid useless
error messages about D flag.

Change-Id: I3a2f5144b3bb271705000b67cd46cd02e98aca77
Reviewed-on: https://go-review.googlesource.com/c/go/+/182077
Run-TryBot: Clément Chigot <clement.chigot@atos.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent 122a4fb7
......@@ -207,9 +207,16 @@ func (tools gccgoToolchain) pack(b *Builder, a *Action, afile string, ofiles []s
}
absAfile := mkAbs(objdir, afile)
// Try with D modifier first, then without if that fails.
if b.run(a, p.Dir, p.ImportPath, nil, tools.ar(), arArgs, "rcD", absAfile, absOfiles) != nil {
output, err := b.runOut(a, p.Dir, nil, tools.ar(), arArgs, "rcD", absAfile, absOfiles)
if err != nil {
return b.run(a, p.Dir, p.ImportPath, nil, tools.ar(), arArgs, "rc", absAfile, absOfiles)
}
if len(output) > 0 {
// Show the output if there is any even without errors.
b.showOutput(a, p.Dir, p.ImportPath, b.processOutput(output))
}
return nil
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment