aboutsummaryrefslogtreecommitdiffstats
path: root/android/arch.go
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2016-12-08 17:23:53 -0800
committerColin Cross <ccross@android.com>2016-12-08 17:27:25 -0800
commitbb2e2b7d7f7a081725c0b14b5f025620d4e25004 (patch)
tree8a987bf683add257223f3a17a51ce4a0b9b3e591 /android/arch.go
parent1d037118275ffa1dbde8d012a5922f518063fe00 (diff)
downloadbuild_soong-bb2e2b7d7f7a081725c0b14b5f025620d4e25004.tar.gz
build_soong-bb2e2b7d7f7a081725c0b14b5f025620d4e25004.tar.bz2
build_soong-bb2e2b7d7f7a081725c0b14b5f025620d4e25004.zip
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
Diffstat (limited to 'android/arch.go')
-rw-r--r--android/arch.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/android/arch.go b/android/arch.go
index 0cd49163..a0617308 100644
--- a/android/arch.go
+++ b/android/arch.go
@@ -444,6 +444,8 @@ func createArchType(props reflect.Type) reflect.Type {
"Android64",
"Android32",
"Not_windows",
+ "Arm_on_x86",
+ "Arm_on_x86_64",
}
for _, os := range osTypeList {
targets = append(targets, os.Field)
@@ -712,6 +714,17 @@ func (a *ModuleBase) setArchProperties(ctx BottomUpMutatorContext) {
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 @@ func decodeTargetProductVariables(config *config) (map[OsClass][]Target, error)
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