Allow CustomizeProperties to override linker

Allow CustomizeProperties to override the dynamic linker by setting a
DynamicLinker property.  Needed by art, which overrides the linker for
device-on-host testing.

Change-Id: Ia4cb5a85b9a995d8138da33eb13543addf3b38cc
This commit is contained in:
Colin Cross
2016-09-07 13:14:06 -07:00
parent 1e8ed27de3
commit 522e373a22

View File

@@ -37,6 +37,8 @@ type BinaryLinkerProperties struct {
// if set, install a symlink to the preferred architecture // if set, install a symlink to the preferred architecture
Symlink_preferred_arch bool Symlink_preferred_arch bool
DynamicLinker string `blueprint:"mutated"`
} }
func init() { func init() {
@@ -222,11 +224,15 @@ func (binary *binaryDecorator) linkerFlags(ctx ModuleContext, flags Flags) Flags
} else { } else {
if flags.DynamicLinker == "" { if flags.DynamicLinker == "" {
if binary.Properties.DynamicLinker != "" {
flags.DynamicLinker = binary.Properties.DynamicLinker
} else {
flags.DynamicLinker = "/system/bin/linker" flags.DynamicLinker = "/system/bin/linker"
if flags.Toolchain.Is64Bit() { if flags.Toolchain.Is64Bit() {
flags.DynamicLinker += "64" flags.DynamicLinker += "64"
} }
} }
}
flags.LdFlags = append(flags.LdFlags, flags.LdFlags = append(flags.LdFlags,
"-pie", "-pie",