mirror of https://github.com/golang/go.git
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/16055 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
parent
26205cb3c0
commit
17a256bf22
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue