Fix binaries and symlinks for prefer32

Track the primary architecture selected for each class based on the
module's multilib setting and the global config.  Fixes building
binaries with multlib set to first and DevicePrefer32BitExecutables set,
and fixes symlinks to binaries with multilib set to prefer32.

Bug: 31452121
Test: mmma -j art HOST_PREFER_32_BIT=true
Change-Id: I75094df42f3273f6d613e4058eaa565957174c28
This commit is contained in:
Colin Cross
2016-09-13 09:59:14 -07:00
parent b1957a5021
commit 8b74d17220
3 changed files with 52 additions and 19 deletions

View File

@@ -170,11 +170,7 @@ func (binary *binaryDecorator) linkerInit(ctx BaseModuleContext) {
if binary.Properties.Stem == "" && binary.Properties.Suffix == "" {
ctx.PropertyErrorf("symlink_preferred_arch", "must also specify stem or suffix")
}
prefer32 := false
if ctx.Device() {
prefer32 = ctx.AConfig().DevicePrefer32BitExecutables()
}
if ctx.PrimaryArch() != prefer32 {
if ctx.TargetPrimary() {
binary.baseInstaller.Properties.Symlinks = append(binary.baseInstaller.Properties.Symlinks,
ctx.ModuleName())
}