summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build/art.go4
-rw-r--r--dex2oat/Android.bp25
2 files changed, 28 insertions, 1 deletions
diff --git a/build/art.go b/build/art.go
index f2a64db4bc..e354f61d3a 100644
--- a/build/art.go
+++ b/build/art.go
@@ -251,7 +251,9 @@ func prefer32Bit(ctx android.LoadHookContext) {
p.Target.Host.Compile_multilib = proptools.StringPtr("prefer32")
}
- ctx.AppendProperties(p)
+ // Prepend to make it overridable in the blueprints. Note that it doesn't work
+ // to override the property in a cc_defaults module.
+ ctx.PrependProperties(p)
}
var testMapKey = android.NewOnceKey("artTests")
diff --git a/dex2oat/Android.bp b/dex2oat/Android.bp
index a4bbf40a8f..e5e5b95f0c 100644
--- a/dex2oat/Android.bp
+++ b/dex2oat/Android.bp
@@ -271,6 +271,24 @@ art_cc_binary {
shared_libs: [
"libz",
],
+ // Override the prefer32 added by art_cc_binary when
+ // HOST_PREFER_32_BIT is in use. Necessary because the logic in
+ // Soong for setting ctx.Config().BuildOSTarget (used in
+ // dexpreopt.RegisterToolDeps) doesn't take host prefer32 into
+ // account. Note that this override cannot be in cc_default because
+ // it'd get overridden by the load hook even when it uses
+ // PrependProperties.
+ compile_multilib: "both",
+ symlink_preferred_arch: true,
+ },
+ linux_glibc_x86: {
+ suffix: "32",
+ },
+ linux_glibc_x86_64: {
+ suffix: "64",
+ },
+ linux_bionic_x86_64: {
+ suffix: "64",
},
},
apex_available: [
@@ -314,6 +332,13 @@ art_cc_binary {
shared_libs: [
"libz",
],
+ // Override the prefer32 added by art_cc_binary when
+ // HOST_PREFER_32_BIT is in use. Necessary because the logic in
+ // Soong for setting ctx.Config().BuildOSTarget (used in
+ // dexpreopt.RegisterToolDeps) doesn't take host prefer32 into
+ // account. Note that this override cannot be in cc_default because
+ // it'd get overridden by the load hook even when it uses
+ // PrependProperties.
compile_multilib: "both",
symlink_preferred_arch: true,
},