summaryrefslogtreecommitdiff
path: root/rust/binary.go
diff options
context:
space:
mode:
author Ivan Lozano <ivanlozano@google.com> 2024-11-08 16:16:50 +0000
committer Ivan Lozano <ivanlozano@google.com> 2025-02-05 03:13:01 +0000
commit1f10f684516b131b5e6aebdf9b7915cf07409510 (patch)
treee4c5d3f6092fedc33807da4532b023bad3759a92 /rust/binary.go
parente068e0cb169335d5c76a27aba7f77088c52fb060 (diff)
rust: Propagate static libs correctly
A dylib link is a final link, so we should not propagate staticlibs through them. Most of the time this made no difference, but this was breaking edge cases on coverage builds. This CL breaks apart linkObjects so we can more finely tune which dependencies we propagate and which we should not. rlibs should only propagate non-whole static librares, while rlibs and dylibs propagate whole static libs. Bug: 377932175 Test: m Test: New Soong tests Change-Id: Ib2ae3dcb7d775a57bd4b1715ec528f48cc0ca026
Diffstat (limited to 'rust/binary.go')
-rw-r--r--rust/binary.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/rust/binary.go b/rust/binary.go
index 3c7a48274..5a03d91c2 100644
--- a/rust/binary.go
+++ b/rust/binary.go
@@ -139,7 +139,10 @@ func (binary *binaryDecorator) compile(ctx ModuleContext, flags Flags, deps Path
flags.RustFlags = append(flags.RustFlags, deps.depFlags...)
flags.LinkFlags = append(flags.LinkFlags, deps.depLinkFlags...)
- flags.LinkFlags = append(flags.LinkFlags, deps.linkObjects...)
+ flags.LinkFlags = append(flags.LinkFlags, deps.rustLibObjects...)
+ flags.LinkFlags = append(flags.LinkFlags, deps.sharedLibObjects...)
+ flags.LinkFlags = append(flags.LinkFlags, deps.staticLibObjects...)
+ flags.LinkFlags = append(flags.LinkFlags, deps.wholeStaticLibObjects...)
if binary.stripper.NeedsStrip(ctx) {
strippedOutputFile := outputFile