Enable arm_on_x86 mode when arm is a secondary arch
Enable arm_on_x86 mode whenever compiling for x86 on the device, and either arm is listed as an ABI on the x86 arch, or arm exists as a target arch. Bug: 35286489 Test: examine bcc cflags Change-Id: Iebd0e7b95f584d25773a60474c27425cac7a578e
This commit is contained in:
@@ -716,17 +716,19 @@ func (a *ModuleBase) setArchProperties(ctx BottomUpMutatorContext) {
|
|||||||
prefix := "target.android32"
|
prefix := "target.android32"
|
||||||
a.appendProperties(ctx, genProps, targetProp, field, prefix)
|
a.appendProperties(ctx, genProps, targetProp, field, prefix)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if arch.ArchType == X86 && hasArmAbi(arch) {
|
if arch.ArchType == X86 && (hasArmAbi(arch) ||
|
||||||
field := "Arm_on_x86"
|
hasArmAndroidArch(ctx.AConfig().Targets[Device])) {
|
||||||
prefix := "target.arm_on_x86"
|
field := "Arm_on_x86"
|
||||||
a.appendProperties(ctx, genProps, targetProp, field, prefix)
|
prefix := "target.arm_on_x86"
|
||||||
}
|
a.appendProperties(ctx, genProps, targetProp, field, prefix)
|
||||||
if arch.ArchType == X86_64 && hasArmAbi(arch) {
|
}
|
||||||
field := "Arm_on_x86_64"
|
if arch.ArchType == X86_64 && (hasArmAbi(arch) ||
|
||||||
prefix := "target.arm_on_x86_64"
|
hasArmAndroidArch(ctx.AConfig().Targets[Device])) {
|
||||||
a.appendProperties(ctx, genProps, targetProp, field, prefix)
|
field := "Arm_on_x86_64"
|
||||||
|
prefix := "target.arm_on_x86_64"
|
||||||
|
a.appendProperties(ctx, genProps, targetProp, field, prefix)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -835,6 +837,16 @@ func hasArmAbi(arch Arch) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// hasArmArch returns true if targets has at least arm Android arch
|
||||||
|
func hasArmAndroidArch(targets []Target) bool {
|
||||||
|
for _, target := range targets {
|
||||||
|
if target.Os == Android && target.Arch.ArchType == Arm {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
type archConfig struct {
|
type archConfig struct {
|
||||||
arch string
|
arch string
|
||||||
archVariant string
|
archVariant string
|
||||||
|
Reference in New Issue
Block a user