Commit 2ffdbd7c authored by Michael Hudson-Doyle's avatar Michael Hudson-Doyle

cmd/go, cmd/link: allow -buildmode=pie on linux/ppc64le

Change-Id: I0d0abbb9503c3a3c35d846fc0379836b2c483dea
Reviewed-on: https://go-review.googlesource.com/15962Reviewed-by: default avatarRuss Cox <rsc@golang.org>
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 5e1d0fcb
......@@ -122,7 +122,7 @@ and test commands:
arguments to pass on each go tool link invocation.
-linkshared
link against shared libraries previously created with
-buildmode=shared
-buildmode=shared.
-pkgdir dir
install and load all packages from dir instead of the usual locations.
For example, when building with a non-standard configuration,
......
......@@ -101,7 +101,7 @@ and test commands:
arguments to pass on each go tool link invocation.
-linkshared
link against shared libraries previously created with
-buildmode=shared
-buildmode=shared.
-pkgdir dir
install and load all packages from dir instead of the usual locations.
For example, when building with a non-standard configuration,
......@@ -332,6 +332,9 @@ func buildModeInit() {
_, gccgo := buildToolchain.(gccgoToolchain)
var codegenArg string
platform := goos + "/" + goarch
if buildBuildmode != "default" {
buildAsmflags = append(buildAsmflags, "-D=GOBUILDMODE_"+strings.Replace(buildBuildmode, "-", "_", -1)+"=1")
}
switch buildBuildmode {
case "archive":
pkgsFilter = pkgsNotMain
......@@ -375,7 +378,7 @@ func buildModeInit() {
fatalf("-buildmode=pie not supported by gccgo")
} else {
switch platform {
case "android/arm", "linux/amd64", "android/amd64":
case "android/arm", "linux/amd64", "android/amd64", "linux/ppc64le":
codegenArg = "-shared"
default:
fatalf("-buildmode=pie not supported on %s\n", platform)
......@@ -389,7 +392,6 @@ func buildModeInit() {
} else {
switch platform {
case "linux/386", "linux/amd64", "linux/arm", "linux/arm64":
buildAsmflags = append(buildAsmflags, "-D=GOBUILDMODE_shared=1")
default:
fatalf("-buildmode=shared not supported on %s\n", platform)
}
......@@ -407,7 +409,7 @@ func buildModeInit() {
codegenArg = "-fPIC"
} else {
switch platform {
case "linux/386", "linux/amd64", "linux/arm", "linux/arm64":
case "linux/386", "linux/amd64", "linux/arm", "linux/arm64", "linux/ppc64le":
buildAsmflags = append(buildAsmflags, "-D=GOBUILDMODE_shared=1")
default:
fatalf("-buildmode=shared not supported on %s\n", platform)
......
......@@ -98,6 +98,11 @@ func archinit() {
ld.Linkmode = ld.LinkInternal
}
switch ld.Buildmode {
case ld.BuildmodePIE:
ld.Linkmode = ld.LinkExternal
}
switch ld.HEADTYPE {
default:
if ld.Linkmode == ld.LinkAuto {
......
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