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
1 changed files with 9 additions and 3 deletions

View File

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