From fd47b1ab6a51ce3b148e2d4644b1d96b058c2064 Mon Sep 17 00:00:00 2001 From: Ivan Lozano Date: Fri, 17 May 2024 14:13:41 -0400 Subject: cc/rust: Alias ffi rlib variant for static_libs Alias the rlib variant to "link: static". This allows declaring rust_ffi_rlib modules in static_libs. This effectively removes any distinction between rust_ffi_static and rust_ffi_rlib. Removing the functionality for building Rust staticlib modules will be cleaned up in a follow-on CL. This should have the effect of changing the default linkage for all rust modules in static_libs from linking individual staticlibs to building a single staticlib that includes all rust_ffi rlib dependencies. This removes the static_rlibs property, as we're now handling the choice dynamically. This also makes rlibs only propagate through cc_library_static modules if the rlib is included in whole_static_lib. This both mirrors the expected behavior of cc libraries and helps control which version of a crate ends up in the final link (e.g. libdoh_ffi vs libdoh_ffi_for_test). Bug: 254469782 Test: m Test: m blueprint_tests Change-Id: I2925f67f6dc9329dae3dcccafb8560900ac8a6fc --- rust/testing.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'rust/testing.go') diff --git a/rust/testing.go b/rust/testing.go index f31c59188..6ee49a971 100644 --- a/rust/testing.go +++ b/rust/testing.go @@ -189,11 +189,11 @@ func registerRequiredBuildComponentsForTest(ctx android.RegistrationContext) { ctx.RegisterModuleType("rust_ffi", RustFFIFactory) ctx.RegisterModuleType("rust_ffi_shared", RustFFISharedFactory) ctx.RegisterModuleType("rust_ffi_rlib", RustFFIRlibFactory) - ctx.RegisterModuleType("rust_ffi_static", RustFFIStaticRlibFactory) + ctx.RegisterModuleType("rust_ffi_static", RustFFIRlibFactory) ctx.RegisterModuleType("rust_ffi_host", RustFFIHostFactory) ctx.RegisterModuleType("rust_ffi_host_shared", RustFFISharedHostFactory) ctx.RegisterModuleType("rust_ffi_host_rlib", RustFFIRlibHostFactory) - ctx.RegisterModuleType("rust_ffi_host_static", RustFFIStaticRlibHostFactory) + ctx.RegisterModuleType("rust_ffi_host_static", RustFFIRlibHostFactory) ctx.RegisterModuleType("rust_proc_macro", ProcMacroFactory) ctx.RegisterModuleType("rust_protobuf", RustProtobufFactory) ctx.RegisterModuleType("rust_protobuf_host", RustProtobufHostFactory) -- cgit v1.2.3-59-g8ed1b