Rust: Vendor support for Rust static libraries.

We don't have Rust VNDK support yet, but static linkage can be
supported in the interim. This adds support for making rust_ffi_static
libraries available to CC vendor modules.

Since rust_ffi_static modules will link against rlibs, we allow rlib
linkage into vendor as well, but only for the variants which use the
rlib libstd.

Bug: 172525289
Test: New Soong tests pass
Test: Example vendor cc_binary links against rust_ffi_static module.
Change-Id: Idf3aeb51e32293866f1ad965e329aa6b9e0bf2ef
This commit is contained in:
Ivan Lozano
2020-12-02 09:15:16 -05:00
parent f9e2172aec
commit 6a88443089
7 changed files with 269 additions and 58 deletions

View File

@@ -92,6 +92,7 @@ func GatherRequiredDepsForTest() string {
srcs: ["foo.rs"],
no_stdlibs: true,
host_supported: true,
vendor_available: true,
native_coverage: false,
sysroot: true,
apex_available: ["//apex_available:platform", "//apex_available:anyapex"],
@@ -102,6 +103,7 @@ func GatherRequiredDepsForTest() string {
srcs: ["foo.rs"],
no_stdlibs: true,
host_supported: true,
vendor_available: true,
native_coverage: false,
sysroot: true,
apex_available: ["//apex_available:platform", "//apex_available:anyapex"],