Commit aa4ec2cd by Ian Lance Taylor

gccgo: suppress "ar rcD" and "-zdefs" on AIX

    
    Reviewed-on: https://go-review.googlesource.com/100955

From-SVN: r259445
parent 1a013c94
3aa5fc91094c5f24b26747ec176ad44cde784fc7 2c7093358e5f5ebeb102d44d1036ca0a807d46a5
The first line of this file holds the git revision number of the last The first line of this file holds the git revision number of the last
merge done from the gofrontend repository. merge done from the gofrontend repository.
...@@ -190,15 +190,15 @@ func (gccgoToolchain) pack(b *Builder, a *Action, afile string, ofiles []string) ...@@ -190,15 +190,15 @@ func (gccgoToolchain) pack(b *Builder, a *Action, afile string, ofiles []string)
} }
absAfile := mkAbs(objdir, afile) absAfile := mkAbs(objdir, afile)
// Try with D modifier first, then without if that fails. // 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" { if cfg.Goos == "aix" && cfg.Goarch == "ppc64" {
// AIX puts both 32-bit and 64-bit objects in the same archive. // 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. // Tell the AIX "ar" command to only care about 64-bit objects.
// AIX "ar" command does not know D option. // AIX "ar" command does not know D option.
return b.run(a, p.Dir, p.ImportPath, nil, "ar", "-X64", "rc", absAfile, absOfiles) arArgs = append(arArgs, "-X64")
} else {
return b.run(a, p.Dir, p.ImportPath, nil, "ar", "rc", absAfile, absOfiles)
} }
return b.run(a, p.Dir, p.ImportPath, nil, "ar", "rc", arArgs, absAfile, absOfiles)
} }
return nil return nil
} }
...@@ -466,7 +466,10 @@ func (tools gccgoToolchain) link(b *Builder, root *Action, out, importcfg string ...@@ -466,7 +466,10 @@ func (tools gccgoToolchain) link(b *Builder, root *Action, out, importcfg string
ldflags = append(ldflags, goLibBegin...) ldflags = append(ldflags, goLibBegin...)
ldflags = append(ldflags, "-lgo", "-lgcc_s", "-lgcc", "-lc", "-lgcc") ldflags = append(ldflags, "-lgo", "-lgcc_s", "-lgcc", "-lc", "-lgcc")
case "shared": 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": case "pie":
ldflags = append(ldflags, "-pie") ldflags = append(ldflags, "-pie")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment