Commit f7c7ed7c authored by Rahul Chaudhry's avatar Rahul Chaudhry Committed by Ian Lance Taylor

cmd/go: set buildmode=pie default for android/arm64.

Just like android/arm, android/arm64 refuses to execute non-PIE
binaries. In addition, starting from the M release (Marshmallow),
Android refuses to execute binaries with any text relocations
(this was just a warning in the L release). This makes "-shared"
necessary as well when building executables for Android.

Change-Id: Id8802de5be98ff472fc370f8d22ffbde316aaf1e
Reviewed-on: https://go-review.googlesource.com/16744Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent 0de59c27
...@@ -361,7 +361,7 @@ func buildModeInit() { ...@@ -361,7 +361,7 @@ func buildModeInit() {
ldBuildmode = "c-shared" ldBuildmode = "c-shared"
case "default": case "default":
switch platform { switch platform {
case "android/arm", "android/amd64": case "android/arm", "android/arm64", "android/amd64":
codegenArg = "-shared" codegenArg = "-shared"
ldBuildmode = "pie" ldBuildmode = "pie"
default: default:
...@@ -375,7 +375,7 @@ func buildModeInit() { ...@@ -375,7 +375,7 @@ func buildModeInit() {
fatalf("-buildmode=pie not supported by gccgo") fatalf("-buildmode=pie not supported by gccgo")
} else { } else {
switch platform { switch platform {
case "linux/arm", "android/arm", "linux/amd64", "android/amd64", "linux/arm64", "linux/ppc64le": case "linux/arm", "android/arm", "linux/amd64", "android/amd64", "linux/arm64", "android/arm64", "linux/ppc64le":
codegenArg = "-shared" codegenArg = "-shared"
default: default:
fatalf("-buildmode=pie not supported on %s\n", platform) fatalf("-buildmode=pie not supported on %s\n", platform)
......
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