aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/cmd
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2019-06-26 00:04:36 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2019-06-26 00:04:36 +0000
commitc31a34018aa6c4f34102e8c5a93cc98def3b5a7b (patch)
treebc9301efe578b218e45f961367984653fdf77579 /libgo/go/cmd
parentebecdd0c3649b02de48836d17baa949fa8f106f8 (diff)
downloadgcc-c31a34018aa6c4f34102e8c5a93cc98def3b5a7b.zip
gcc-c31a34018aa6c4f34102e8c5a93cc98def3b5a7b.tar.gz
gcc-c31a34018aa6c4f34102e8c5a93cc98def3b5a7b.tar.bz2
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. The corresponding Go toolchain patch is CL 182077. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/183817 From-SVN: r272661
Diffstat (limited to 'libgo/go/cmd')
-rw-r--r--libgo/go/cmd/go/internal/work/gccgo.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/libgo/go/cmd/go/internal/work/gccgo.go b/libgo/go/cmd/go/internal/work/gccgo.go
index a0eb2d3..3b97209 100644
--- a/libgo/go/cmd/go/internal/work/gccgo.go
+++ b/libgo/go/cmd/go/internal/work/gccgo.go
@@ -209,9 +209,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(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
}