diff options
author | 2025-01-08 03:17:19 +0000 | |
---|---|---|
committer | 2025-01-10 21:30:56 +0000 | |
commit | 9587f45b194ad3f1a4676a7f5d24acce03efc204 (patch) | |
tree | a8630a5d69173e240f1f99760f8b682c474da748 /rust/rust.go | |
parent | 18ac30a5484bca433621a1d5ec56fbe6e9b798fb (diff) |
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
Diffstat (limited to 'rust/rust.go')
-rw-r--r-- | rust/rust.go | 10 |
1 files changed, 10 insertions, 0 deletions
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) |