Support arm_on_x86 properties
Allow Android.bp files to set properties when an x86 device supports
arm abis.
Test: lunch aosp_fugu-userdebug && mmma -j frameworks/compile/libbcc
Change-Id: Ic142a3f93175924a826dea9908b2e5183a486184
diff --git a/android/arch.go b/android/arch.go
index 0cd4916..a061730 100644
--- a/android/arch.go
+++ b/android/arch.go
@@ -444,6 +444,8 @@
"Android64",
"Android32",
"Not_windows",
+ "Arm_on_x86",
+ "Arm_on_x86_64",
}
for _, os := range osTypeList {
targets = append(targets, os.Field)
@@ -712,6 +714,17 @@
a.appendProperties(ctx, genProps, targetProp, field, prefix)
}
}
+
+ if arch.ArchType == X86 && hasArmAbi(arch) {
+ field := "Arm_on_x86"
+ prefix := "target.arm_on_x86"
+ a.appendProperties(ctx, genProps, targetProp, field, prefix)
+ }
+ if arch.ArchType == X86_64 && hasArmAbi(arch) {
+ field := "Arm_on_x86_64"
+ prefix := "target.arm_on_x86_64"
+ a.appendProperties(ctx, genProps, targetProp, field, prefix)
+ }
}
}
@@ -805,6 +818,16 @@
return targets, nil
}
+// hasArmAbi returns true if arch has at least one arm ABI
+func hasArmAbi(arch Arch) bool {
+ for _, abi := range arch.Abi {
+ if strings.HasPrefix(abi, "arm") {
+ return true
+ }
+ }
+ return false
+}
+
type archConfig struct {
arch string
archVariant string