From 806efd3885d6eecfa1b1bd1697431c0ab073a76a Mon Sep 17 00:00:00 2001 From: Ivan Lozano Date: Wed, 11 Dec 2024 21:38:53 +0000 Subject: rust: Alias rust_ffi_rlib to rust_library_rlib With the new transition mutators, the distinctions between rust_ffi_rlib and rust_library_rlib are not necessary. This CL removes the remaining distinctions to allow an unusual use case where a rust_library and a rust_ffi_rlib would otherwise be created from the same source. This would allow defining a single rust_library_rlib that works for both rust modules and cc modules. One key change is that rust_ffi_rlibs only produced an rlib-std variant previously, and now produce dylib-std variants as well.This surfaced an issue where a libstd linkage mismatch would cause rustc to throw a consufing missing crate error. We instead add logic to catch this in Soong and provide a more useful error message. Bug: 383552450 Test: m rust Test: m blueprint_tests Change-Id: I611ca46934059735d06229952cfd8e0ab7050486 --- rust/binary.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'rust/binary.go') diff --git a/rust/binary.go b/rust/binary.go index cba29a023..d22041b27 100644 --- a/rust/binary.go +++ b/rust/binary.go @@ -165,11 +165,11 @@ func (binary *binaryDecorator) autoDep(ctx android.BottomUpMutatorContext) autoD } } -func (binary *binaryDecorator) stdLinkage(ctx *depsContext) RustLinkage { +func (binary *binaryDecorator) stdLinkage(device bool) RustLinkage { if binary.preferRlib() { return RlibLinkage } - return binary.baseCompiler.stdLinkage(ctx) + return binary.baseCompiler.stdLinkage(device) } func (binary *binaryDecorator) binary() bool { -- cgit v1.2.3-59-g8ed1b