Support installing non-native arch binaries am: 17f052647f am: a3ecd8752f

am: 389dd5da20

* commit '389dd5da20717f244d3526823b4746fcfd397aa4':
  Support installing non-native arch binaries

Change-Id: I98bb3e976c9d50236371d7c4218e5ecb4885c525
This commit is contained in:
Dan Willemsen
2016-06-01 01:20:10 +00:00
committed by android-build-merger
2 changed files with 9 additions and 0 deletions

View File

@@ -303,6 +303,7 @@ type Arch struct {
CpuVariant string
Abi []string
ArchFeatures []string
Native bool
}
func (a Arch) String() string {
@@ -911,6 +912,9 @@ func decodeArchProductVariables(variables productVariables) (map[HostType][]Arch
if err != nil {
return nil, nil, err
}
if deviceArch.ArchType.Multilib == deviceSecondaryArch.ArchType.Multilib {
deviceSecondaryArch.Native = false
}
deviceArches = append(deviceArches, deviceSecondaryArch)
}
@@ -973,6 +977,7 @@ func decodeMegaDevice() ([]Arch, error) {
if err != nil {
return nil, err
}
arch.Native = false
ret = append(ret, arch)
}
@@ -1005,6 +1010,7 @@ func decodeArch(arch string, archVariant, cpuVariant *string, abi *[]string) (Ar
ArchVariant: stringPtr(archVariant),
CpuVariant: stringPtr(cpuVariant),
Abi: slicePtr(abi),
Native: true,
}
if a.ArchVariant == a.ArchType.Name || a.ArchVariant == "generic" {

View File

@@ -1347,6 +1347,9 @@ func (installer *baseInstaller) install(ctx ModuleContext, file android.Path) {
if ctx.toolchain().Is64Bit() && installer.dir64 != "" {
subDir = installer.dir64
}
if !ctx.Host() && !ctx.Arch().Native {
subDir = filepath.Join(subDir, ctx.Arch().ArchType.String())
}
dir := android.PathForModuleInstall(ctx, subDir, installer.Properties.Relative_install_path)
installer.path = ctx.InstallFile(dir, file)
}