diff --git a/rust/compiler.go b/rust/compiler.go index 586063e91..224e2017d 100644 --- a/rust/compiler.go +++ b/rust/compiler.go @@ -254,7 +254,7 @@ func (compiler *baseCompiler) compilerDeps(ctx DepsContext, deps Deps) Deps { if !Bool(compiler.Properties.No_stdlibs) { for _, stdlib := range config.Stdlibs { // 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() { + if ctx.Target().Os == android.BuildOs { stdlib = stdlib + "_" + ctx.toolchain().RustTriple() } diff --git a/rust/testing.go b/rust/testing.go index 4c4df4a6d..1afe27ef0 100644 --- a/rust/testing.go +++ b/rust/testing.go @@ -45,6 +45,30 @@ func GatherRequiredDepsForTest() string { host_supported: true, sysroot: true, } + rust_prebuilt_library { + name: "libstd_i686-unknown-linux-gnu", + crate_name: "std", + rlib: { + srcs: ["libstd.rlib"], + }, + dylib: { + srcs: ["libstd.so"], + }, + host_supported: true, + sysroot: true, + } + rust_prebuilt_library { + name: "libtest_i686-unknown-linux-gnu", + crate_name: "test", + rlib: { + srcs: ["libtest.rlib"], + }, + dylib: { + srcs: ["libtest.so"], + }, + host_supported: true, + sysroot: true, + } rust_prebuilt_library { name: "libstd_x86_64-apple-darwin", crate_name: "std",