Allow clang builds to disable -pie am: 7a108bccad
am: 5a96f180b2
Change-Id: I14ac99c6493a95a86f08912f8aabf428a7e78072
This commit is contained in:
commit
649d6f30cd
11
cc/binary.go
11
cc/binary.go
|
@ -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,9 +197,11 @@ func (binary *binaryDecorator) linkerFlags(ctx ModuleContext, flags Flags) Flags
|
|||
flags = binary.baseLinker.linkerFlags(ctx, flags)
|
||||
|
||||
if ctx.Host() && !binary.static() {
|
||||
flags.LdFlags = append(flags.LdFlags, "-pie")
|
||||
if ctx.Os() == android.Windows {
|
||||
flags.LdFlags = append(flags.LdFlags, "-Wl,-e_mainCRTStartup")
|
||||
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")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue