Merge "Don't disable rust modules for linux_bionic"
diff --git a/rust/compiler.go b/rust/compiler.go
index ddf1fac..664578d 100644
--- a/rust/compiler.go
+++ b/rust/compiler.go
@@ -216,8 +216,8 @@
if !Bool(compiler.Properties.No_stdlibs) {
for _, stdlib := range config.Stdlibs {
- // If we're building for the primary host target, use the compiler's stdlibs
- if ctx.Host() && ctx.TargetPrimary() {
+ // If we're building for the primary arch of the build host, use the compiler's stdlibs
+ if ctx.Target().Os == android.BuildOs && ctx.TargetPrimary() {
stdlib = stdlib + "_" + ctx.toolchain().RustTriple()
}
diff --git a/rust/rust.go b/rust/rust.go
index 4cba6d6..b98992c 100644
--- a/rust/rust.go
+++ b/rust/rust.go
@@ -560,21 +560,6 @@
android.InitAndroidArchModule(mod, mod.hod, mod.multilib)
android.InitDefaultableModule(mod)
-
- // Explicitly disable unsupported targets.
- android.AddLoadHook(mod, func(ctx android.LoadHookContext) {
- disableTargets := struct {
- Target struct {
- Linux_bionic struct {
- Enabled *bool
- }
- }
- }{}
- disableTargets.Target.Linux_bionic.Enabled = proptools.BoolPtr(false)
-
- ctx.AppendProperties(&disableTargets)
- })
-
return mod
}