summaryrefslogtreecommitdiff
path: root/rust/builder.go
diff options
context:
space:
mode:
author Ivan Lozano <ivanlozano@google.com> 2020-04-28 10:10:23 -0400
committer Ivan Lozano <ivanlozano@google.com> 2020-04-29 15:31:34 -0400
commit9d1df10e2a7aacb4ada52000dc299ce8c187330a (patch)
tree46e467230778530d2ddac2cdcabccc33e1be757b /rust/builder.go
parent52c0b7b35b5c5b510bac0a0a98d493b7d953a10d (diff)
Provide 32-bit and 64-bit Rust libs by default.
CC libraries which depend on Rust libraries get missing dependency errors when building 32-bit variants dependent on Rust modules which don't explicitly have "multilib: both" declared. Because CC libraries use MultilibBoth by default, Rust should do the same. This also fixes a bug where the ARM32 toolchain incorrectly embedded toolchain64Bit instead of toolchain32Bit. Bug: 154730212 Test: Rust libraries provide both variants by default. Change-Id: Ia545fe069d3c6b77c3d18f4f10267e2c72ee0bab
Diffstat (limited to 'rust/builder.go')
-rw-r--r--rust/builder.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/rust/builder.go b/rust/builder.go
index 27eeec23d..2d5e602ca 100644
--- a/rust/builder.go
+++ b/rust/builder.go
@@ -108,8 +108,8 @@ func transformSrctoCrate(ctx android.ModuleContext, main android.Path, deps Path
}
// TODO once we have static libraries in the host prebuilt .bp, this
// should be unconditionally added.
- if !ctx.Host() {
- // If we're on a device build, do not use an implicit sysroot
+ if !(ctx.Host() && ctx.TargetPrimary()) {
+ // If we're not targeting the host primary arch, do not use an implicit sysroot
rustcFlags = append(rustcFlags, "--sysroot=/dev/null")
}
// Collect linker flags