diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-03-05 22:40:21 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-03-05 22:40:21 +0000 |
commit | b211cd1b4639a0ee3be5f643bde10b1c1683bb58 (patch) | |
tree | da7675a55880f51e117ece129430bd7006188e8b /libgo/go/cmd | |
parent | 507318f109624f58d4bf554c3ad284cdf09324e3 (diff) | |
download | gcc-b211cd1b4639a0ee3be5f643bde10b1c1683bb58.zip gcc-b211cd1b4639a0ee3be5f643bde10b1c1683bb58.tar.gz gcc-b211cd1b4639a0ee3be5f643bde10b1c1683bb58.tar.bz2 |
cmd/go: pass -X64 to ar on aix/ppc64
On aix/ppc64, ar tool must always have -X64 argument if it aims to
create 64 bits archives.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/165317
From-SVN: r269404
Diffstat (limited to 'libgo/go/cmd')
-rw-r--r-- | libgo/go/cmd/go/internal/work/gccgo.go | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/libgo/go/cmd/go/internal/work/gccgo.go b/libgo/go/cmd/go/internal/work/gccgo.go index cb7d560..a0eb2d3 100644 --- a/libgo/go/cmd/go/internal/work/gccgo.go +++ b/libgo/go/cmd/go/internal/work/gccgo.go @@ -278,6 +278,13 @@ func (tools gccgoToolchain) link(b *Builder, root *Action, out, importcfg string return nil } + var arArgs []string + 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. + arArgs = []string{"-X64"} + } + newID := 0 readAndRemoveCgoFlags := func(archive string) (string, error) { newID++ @@ -293,11 +300,11 @@ func (tools gccgoToolchain) link(b *Builder, root *Action, out, importcfg string b.Showcmd("", "ar d %s _cgo_flags", newArchive) return "", nil } - err := b.run(root, root.Objdir, desc, nil, tools.ar(), "x", newArchive, "_cgo_flags") + err := b.run(root, root.Objdir, desc, nil, tools.ar(), arArgs, "x", newArchive, "_cgo_flags") if err != nil { return "", err } - err = b.run(root, ".", desc, nil, tools.ar(), "d", newArchive, "_cgo_flags") + err = b.run(root, ".", desc, nil, tools.ar(), arArgs, "d", newArchive, "_cgo_flags") if err != nil { return "", err } @@ -516,7 +523,7 @@ func (tools gccgoToolchain) link(b *Builder, root *Action, out, importcfg string switch buildmode { case "c-archive": - if err := b.run(root, ".", desc, nil, tools.ar(), "rc", realOut, out); err != nil { + if err := b.run(root, ".", desc, nil, tools.ar(), arArgs, "rc", realOut, out); err != nil { return err } } |