mirror of
https://github.com/golang/go
synced 2024-11-12 08:50:22 -07:00
cmd: enable -buildmode=pie on aix/ppc64
Change-Id: I939518462c931ba9feb125b2f299ef0706b124ce Reviewed-on: https://go-review.googlesource.com/c/go/+/168879 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
08692bed1e
commit
cf952e9e62
3
src/cmd/dist/test.go
vendored
3
src/cmd/dist/test.go
vendored
@ -963,7 +963,8 @@ func (t *tester) supportedBuildmode(mode string) bool {
|
||||
return false
|
||||
case "pie":
|
||||
switch pair {
|
||||
case "linux-386", "linux-amd64", "linux-arm", "linux-arm64", "linux-ppc64le", "linux-s390x",
|
||||
case "aix/ppc64",
|
||||
"linux-386", "linux-amd64", "linux-arm", "linux-arm64", "linux-ppc64le", "linux-s390x",
|
||||
"android-amd64", "android-arm", "android-arm64", "android-386":
|
||||
return true
|
||||
case "darwin-amd64":
|
||||
|
@ -164,6 +164,7 @@ func buildModeInit() {
|
||||
codegenArg = "-shared"
|
||||
case "darwin/amd64":
|
||||
codegenArg = "-shared"
|
||||
case "aix/ppc64":
|
||||
default:
|
||||
base.Fatalf("-buildmode=pie not supported on %s\n", platform)
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ func (mode *BuildMode) Set(s string) error {
|
||||
*mode = BuildModeExe
|
||||
case "pie":
|
||||
switch objabi.GOOS {
|
||||
case "android", "linux":
|
||||
case "aix", "android", "linux":
|
||||
case "darwin", "freebsd":
|
||||
switch objabi.GOARCH {
|
||||
case "amd64":
|
||||
|
@ -179,7 +179,7 @@ func (ctxt *Link) CanUsePlugins() bool {
|
||||
func (ctxt *Link) UseRelro() bool {
|
||||
switch ctxt.BuildMode {
|
||||
case BuildModeCArchive, BuildModeCShared, BuildModeShared, BuildModePIE, BuildModePlugin:
|
||||
return ctxt.IsELF
|
||||
return ctxt.IsELF || ctxt.HeadType == objabi.Haix
|
||||
default:
|
||||
return ctxt.linkShared || (ctxt.HeadType == objabi.Haix && ctxt.LinkMode == LinkExternal)
|
||||
}
|
||||
@ -1173,7 +1173,7 @@ func (ctxt *Link) hostlink() {
|
||||
}
|
||||
case BuildModePIE:
|
||||
// ELF.
|
||||
if ctxt.HeadType != objabi.Hdarwin {
|
||||
if ctxt.HeadType != objabi.Hdarwin && ctxt.HeadType != objabi.Haix {
|
||||
if ctxt.UseRelro() {
|
||||
argv = append(argv, "-Wl,-z,relro")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user