Commit 17a256bf authored by David Crawshaw's avatar David Crawshaw

cmd/go: -buildmode=pie for android/arm

Also make PIE executables the default build mode, as PIE executables
are required as of Android L.

For #10807

Change-Id: I86b7556b9792105cd2531df1b8f3c8f7a8c5d25c
Reviewed-on: https://go-review.googlesource.com/16055Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
parent 26205cb3
......@@ -353,10 +353,28 @@ func buildModeInit() {
}
ldBuildmode = "c-shared"
case "default":
ldBuildmode = "exe"
switch platform {
case "android/arm":
codegenArg = "-shared"
ldBuildmode = "pie"
default:
ldBuildmode = "exe"
}
case "exe":
pkgsFilter = pkgsMain
ldBuildmode = "exe"
case "pie":
if gccgo {
fatalf("-buildmode=pie not supported by gccgo")
} else {
switch platform {
case "android/arm":
codegenArg = "-shared"
default:
fatalf("-buildmode=pie not supported on %s\n", platform)
}
}
ldBuildmode = "pie"
case "shared":
pkgsFilter = pkgsNotMain
if gccgo {
......
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