]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cmd/go: restore passing D to ar
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 1 Mar 2019 22:22:18 +0000 (22:22 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 1 Mar 2019 22:22:18 +0000 (22:22 +0000)
    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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@269333 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/go/gofrontend/MERGE
libgo/go/cmd/go/internal/work/gccgo.go

index 43c8b6bf1eb1dda461f655f78872a23998a1e8af..62ce2015df731dc26e934d69b4e99c73d3c5a692 100644 (file)
@@ -1,4 +1,4 @@
-805c82cc141c593ea2f27d8614ecd204e2b5e76e
+a72eca1f435002076655fd6a54ce869ac39856dc
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index 3c5587008b202c6752f9fa0a10de3a1d6c337c5f..cb7d560f5cffa0c1553d51946e2be5197fd6cf7e 100644 (file)
@@ -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 {