From 9587f45b194ad3f1a4676a7f5d24acce03efc204 Mon Sep 17 00:00:00 2001 From: Ivan Lozano Date: Wed, 8 Jan 2025 03:17:19 +0000 Subject: rust: Add CcInfo.LinkerInfo to Rust modules This prepares Rust modules for stubs and ensures that as CC modules use more of the CcInfo logic, Rust modules are providing the expected information. Bug: 203478530 Test: m Change-Id: I698eca7253010697ce72b2d39dcb6edf864f4581 --- rust/rust.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'rust/rust.go') diff --git a/rust/rust.go b/rust/rust.go index a4c1afd45..2332b52ec 100644 --- a/rust/rust.go +++ b/rust/rust.go @@ -1104,6 +1104,16 @@ func (mod *Module) GenerateAndroidBuildActions(actx android.ModuleContext) { IsPrebuilt: mod.IsPrebuilt(), } + // Define the linker info if compiler != nil because Rust currently + // does compilation and linking in one step. If this changes in the future, + // move this as appropriate. + ccInfo.LinkerInfo = &cc.LinkerInfo{ + WholeStaticLibs: mod.compiler.baseCompilerProps().Whole_static_libs, + StaticLibs: mod.compiler.baseCompilerProps().Static_libs, + SharedLibs: mod.compiler.baseCompilerProps().Shared_libs, + UnstrippedOutputFile: mod.UnstrippedOutputFile(), + } + android.SetProvider(ctx, cc.CcInfoProvider, ccInfo) mod.setOutputFiles(ctx) -- cgit v1.2.3-59-g8ed1b