aboutsummaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2019-03-01 22:22:18 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2019-03-01 22:22:18 +0000
commit8ea1c33cb31be21fd7dc99402eee65f333b41521 (patch)
tree442919537d8ee973fb57b23020814cdd9b96200e /libgo
parent6d9fa41bae42fa4f618ca701cbaa8c7bb7be1392 (diff)
downloadgcc-8ea1c33cb31be21fd7dc99402eee65f333b41521.zip
gcc-8ea1c33cb31be21fd7dc99402eee65f333b41521.tar.gz
gcc-8ea1c33cb31be21fd7dc99402eee65f333b41521.tar.bz2
cmd/go: restore passing D to ar
This restores part of https://golang.org/cl/45695 that was accidentally lost in https://golang.org/cl/158019 (the update to Go1.12beta2). Reviewed-on: https://go-review.googlesource.com/c/164737 From-SVN: r269333
Diffstat (limited to 'libgo')
-rw-r--r--libgo/go/cmd/go/internal/work/gccgo.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/libgo/go/cmd/go/internal/work/gccgo.go b/libgo/go/cmd/go/internal/work/gccgo.go
index 3c55870..cb7d560 100644
--- a/libgo/go/cmd/go/internal/work/gccgo.go
+++ b/libgo/go/cmd/go/internal/work/gccgo.go
@@ -205,11 +205,14 @@ func (tools gccgoToolchain) pack(b *Builder, a *Action, afile string, ofiles []s
if cfg.Goos == "aix" && cfg.Goarch == "ppc64" {
// AIX puts both 32-bit and 64-bit objects in the same archive.
// Tell the AIX "ar" command to only care about 64-bit objects.
- // AIX "ar" command does not know D option.
arArgs = []string{"-X64"}
}
-
- return b.run(a, p.Dir, p.ImportPath, nil, tools.ar(), arArgs, "rc", mkAbs(objdir, afile), absOfiles)
+ 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 {
+ return b.run(a, p.Dir, p.ImportPath, nil, tools.ar(), arArgs, "rc", absAfile, absOfiles)
+ }
+ return nil
}
func (tools gccgoToolchain) link(b *Builder, root *Action, out, importcfg string, allactions []*Action, buildmode, desc string) error {