aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2015-03-26 14:44:26 -0700
committerColin Cross <ccross@android.com>2015-03-27 15:58:24 -0700
commitf8209413f152aba93520e9f0426b2d69d7058497 (patch)
tree10d24715995216e36a9331192f6e75ab31d5ada5
parentbfae8859f2d79093acbc1effe27493ce0cb793ba (diff)
downloadbuild_soong-f8209413f152aba93520e9f0426b2d69d7058497.tar.gz
build_soong-f8209413f152aba93520e9f0426b2d69d7058497.tar.bz2
build_soong-f8209413f152aba93520e9f0426b2d69d7058497.zip
Support target: { android64: {...}} for linker
The linker and a few other executables and libraries need to know if they are a 32-bit process running on a 64-bit host. Add android64 and android32 target types to set custom cflags. Change-Id: I142378e2d5be17a87ff761257dacc1734b093048
-rw-r--r--common/arch.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/common/arch.go b/common/arch.go
index 02212ade..830a2ce7 100644
--- a/common/arch.go
+++ b/common/arch.go
@@ -104,6 +104,8 @@ type archProperties struct {
Target struct {
Host interface{}
Android interface{}
+ Android64 interface{}
+ Android32 interface{}
Linux interface{}
Darwin interface{}
Windows interface{}
@@ -404,6 +406,28 @@ func (a *AndroidModuleBase) setArchProperties(ctx blueprint.EarlyMutatorContext,
reflect.ValueOf(a.archProperties[i].Target).FieldByName("Not_windows").Elem().Elem())
}
+ // Handle 64-bit device properties in the form:
+ // target {
+ // android64 {
+ // key: value,
+ // },
+ // android32 {
+ // key: value,
+ // },
+ // },
+ // WARNING: this is probably not what you want to use in your blueprints file, it selects
+ // options for all targets on a device that supports 64-bit binaries, not just the targets
+ // that are being compiled for 64-bit. Its expected use case is binaries like linker and
+ // debuggerd that need to know when they are a 32-bit process running on a 64-bit device
+ if hod.Device() {
+ if true /* && target_is_64_bit */ {
+ extendProperties(ctx, "target", "android64", generalPropsValue,
+ reflect.ValueOf(a.archProperties[i].Target).FieldByName("Android64").Elem().Elem())
+ } else {
+ extendProperties(ctx, "target", "android32", generalPropsValue,
+ reflect.ValueOf(a.archProperties[i].Target).FieldByName("Android32").Elem().Elem())
+ }
+ }
if ctx.Failed() {
return
}