From 2b0811310eb79c98966220f2336fbd22bdef4110 Mon Sep 17 00:00:00 2001 From: Ivan Lozano Date: Tue, 8 Sep 2020 12:46:52 -0400 Subject: rust: Add libstd linkage mutator for rlibs. The current state of linkage is that device targets always link libstd dynamically except for rust_ffi_static which requires a static libstd linkage. However this prevents producing rust_ffi_static modules which depend on other Rust libraries as those dependencies will link libstd dynamically and cause a collision. We also want our rust_test modules to statically link in libstd as well. This adds a linkage mutator for rlibs that creates a variant for each libstd linkage. Dependent modules can then select the variant that matches their linkage of libstd. Also fixes an issue where installation paths were being generated for rlibs and static libs even though they weren't being installed. This broke when adding the linkage mutator as Make would complain about multiple targets producing the same output. Bug: 168729404 Test: rust_ffi_static module with other rustlib dependency can be built. Change-Id: I955b484bf5809e8fc5517750c7f8df82d3ca8895 --- rust/coverage_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'rust/coverage_test.go') diff --git a/rust/coverage_test.go b/rust/coverage_test.go index 73673d035..90155ca6e 100644 --- a/rust/coverage_test.go +++ b/rust/coverage_test.go @@ -154,12 +154,12 @@ func TestCoverageZip(t *testing.T) { } // Make sure the expected inputs are provided to the zip rule. - if !android.SuffixInList(fizzZipInputs, "android_arm64_armv8-a_rlib_cov/librlib.gcno") || + if !android.SuffixInList(fizzZipInputs, "android_arm64_armv8-a_rlib_dylib-std_cov/librlib.gcno") || !android.SuffixInList(fizzZipInputs, "android_arm64_armv8-a_static_cov/libbaz.gcno") || !android.SuffixInList(fizzZipInputs, "android_arm64_armv8-a_cov/fizz.gcno") { t.Fatalf("missing expected coverage files for rust 'fizz' binary: %#v", fizzZipInputs) } - if !android.SuffixInList(libfooZipInputs, "android_arm64_armv8-a_rlib_cov/librlib.gcno") || + if !android.SuffixInList(libfooZipInputs, "android_arm64_armv8-a_rlib_dylib-std_cov/librlib.gcno") || !android.SuffixInList(libfooZipInputs, "android_arm64_armv8-a_dylib_cov/libfoo.dylib.gcno") { t.Fatalf("missing expected coverage files for rust 'fizz' binary: %#v", libfooZipInputs) } -- cgit v1.2.3-59-g8ed1b