Allow clang builds to disable -pie am: 7a108bccad

am: 5a96f180b2

Change-Id: I14ac99c6493a95a86f08912f8aabf428a7e78072
This commit is contained in:
Colin Cross 2017-01-31 17:46:01 +00:00 committed by android-build-merger
commit 649d6f30cd
1 changed files with 8 additions and 3 deletions

View File

@ -41,6 +41,9 @@ type BinaryLinkerProperties struct {
// extension (if any) appended
Symlinks []string `android:"arch_variant"`
// do not pass -pie
No_pie *bool `android:"arch_variant"`
DynamicLinker string `blueprint:"mutated"`
}
@ -194,11 +197,13 @@ func (binary *binaryDecorator) linkerFlags(ctx ModuleContext, flags Flags) Flags
flags = binary.baseLinker.linkerFlags(ctx, flags)
if ctx.Host() && !binary.static() {
if !ctx.AConfig().IsEnvTrue("DISABLE_HOST_PIE") {
flags.LdFlags = append(flags.LdFlags, "-pie")
if ctx.Os() == android.Windows {
flags.LdFlags = append(flags.LdFlags, "-Wl,-e_mainCRTStartup")
}
}
}
// MinGW spits out warnings about -fPIC even for -fpie?!) being ignored because
// all code is position independent, and then those warnings get promoted to