This patch by Clément Chigot modifies the go tool to not display failures when invoking ar with the D flag if the flag is not supported. The corresponding Go toolchain patch is https://golang.org/cl/182077. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline.
Ian
Index: gcc/go/gofrontend/MERGE =================================================================== --- gcc/go/gofrontend/MERGE (revision 272633) +++ gcc/go/gofrontend/MERGE (working copy) @@ -1,4 +1,4 @@ -a857aad2f3994e6fa42a6fc65330e65d209597a0 +1d6578a20a9a2ee599a07f03cf7f8e7797d72b9c The first line of this file holds the git revision number of the last merge done from the gofrontend repository. Index: libgo/go/cmd/go/internal/work/gccgo.go =================================================================== --- libgo/go/cmd/go/internal/work/gccgo.go (revision 272608) +++ libgo/go/cmd/go/internal/work/gccgo.go (working copy) @@ -209,9 +209,16 @@ func (tools gccgoToolchain) pack(b *Buil } 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 }