aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2018-04-17 20:10:49 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2018-04-17 20:10:49 +0000
commitaa4ec2cdff98cdeec085fa14af4267a51e4e1052 (patch)
treea5c9195c263f5964ae5d1c203fe7a8922d435989
parent1a013c9442553813a6a8f76de9360edc028639fe (diff)
downloadgcc-aa4ec2cdff98cdeec085fa14af4267a51e4e1052.zip
gcc-aa4ec2cdff98cdeec085fa14af4267a51e4e1052.tar.gz
gcc-aa4ec2cdff98cdeec085fa14af4267a51e4e1052.tar.bz2
gccgo: suppress "ar rcD" and "-zdefs" on AIX
Reviewed-on: https://go-review.googlesource.com/100955 From-SVN: r259445
-rw-r--r--gcc/go/gofrontend/MERGE2
-rw-r--r--libgo/go/cmd/go/internal/work/gccgo.go13
2 files changed, 9 insertions, 6 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index 76b5aca..f85a667 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-3aa5fc91094c5f24b26747ec176ad44cde784fc7
+2c7093358e5f5ebeb102d44d1036ca0a807d46a5
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
diff --git a/libgo/go/cmd/go/internal/work/gccgo.go b/libgo/go/cmd/go/internal/work/gccgo.go
index 72d4d9d..1ab7e4e 100644
--- a/libgo/go/cmd/go/internal/work/gccgo.go
+++ b/libgo/go/cmd/go/internal/work/gccgo.go
@@ -190,15 +190,15 @@ func (gccgoToolchain) pack(b *Builder, a *Action, afile string, ofiles []string)
}
absAfile := mkAbs(objdir, afile)
// Try with D modifier first, then without if that fails.
- if b.run(a, p.Dir, p.ImportPath, nil, "ar", "rcD", absAfile, absOfiles) != nil {
+ if cfg.Goos == "aix" || b.run(a, p.Dir, p.ImportPath, nil, "ar", "rcD", absAfile, absOfiles) != 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.
// AIX "ar" command does not know D option.
- return b.run(a, p.Dir, p.ImportPath, nil, "ar", "-X64", "rc", absAfile, absOfiles)
- } else {
- return b.run(a, p.Dir, p.ImportPath, nil, "ar", "rc", absAfile, absOfiles)
+ arArgs = append(arArgs, "-X64")
}
+ return b.run(a, p.Dir, p.ImportPath, nil, "ar", "rc", arArgs, absAfile, absOfiles)
}
return nil
}
@@ -466,7 +466,10 @@ func (tools gccgoToolchain) link(b *Builder, root *Action, out, importcfg string
ldflags = append(ldflags, goLibBegin...)
ldflags = append(ldflags, "-lgo", "-lgcc_s", "-lgcc", "-lc", "-lgcc")
case "shared":
- ldflags = append(ldflags, "-zdefs", "-shared", "-nostdlib", "-lgo", "-lgcc_s", "-lgcc", "-lc")
+ if cfg.Goos != "aix" {
+ ldflags = append(ldflags, "-zdefs")
+ }
+ ldflags = append(ldflags, "-shared", "-nostdlib", "-lgo", "-lgcc_s", "-lgcc", "-lc")
case "pie":
ldflags = append(ldflags, "-pie")