From 9d1df10e2a7aacb4ada52000dc299ce8c187330a Mon Sep 17 00:00:00 2001 From: Ivan Lozano Date: Tue, 28 Apr 2020 10:10:23 -0400 Subject: 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 --- rust/rust_test.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'rust/rust_test.go') diff --git a/rust/rust_test.go b/rust/rust_test.go index 02b190f0f..32eddc161 100644 --- a/rust/rust_test.go +++ b/rust/rust_test.go @@ -240,7 +240,7 @@ func TestNoStdlibs(t *testing.T) { rust_binary { name: "fizz-buzz", srcs: ["foo.rs"], - no_stdlibs: true, + no_stdlibs: true, }`) module := ctx.ModuleForTests("fizz-buzz", "android_arm64_armv8-a").Module().(*Module) @@ -248,3 +248,16 @@ func TestNoStdlibs(t *testing.T) { t.Errorf("no_stdlibs did not suppress dependency on libstd") } } + +// Test that libraries provide both 32-bit and 64-bit variants. +func TestMultilib(t *testing.T) { + ctx := testRust(t, ` + rust_library_rlib { + name: "libfoo", + srcs: ["foo.rs"], + crate_name: "foo", + }`) + + _ = ctx.ModuleForTests("libfoo", "android_arm64_armv8-a_rlib") + _ = ctx.ModuleForTests("libfoo", "android_arm_armv7-a-neon_rlib") +} -- cgit v1.2.3-59-g8ed1b