1
0
mirror of https://github.com/golang/go synced 2024-11-18 00:14:47 -07:00

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/16744
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Rahul Chaudhry 2015-11-08 23:30:43 -08:00 committed by Ian Lance Taylor
parent 0de59c27eb
commit f7c7ed7c41

View File

@ -361,7 +361,7 @@ func buildModeInit() {
ldBuildmode = "c-shared"
case "default":
switch platform {
case "android/arm", "android/amd64":
case "android/arm", "android/arm64", "android/amd64":
codegenArg = "-shared"
ldBuildmode = "pie"
default:
@ -375,7 +375,7 @@ func buildModeInit() {
fatalf("-buildmode=pie not supported by gccgo")
} else {
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"
default:
fatalf("-buildmode=pie not supported on %s\n", platform)