summaryrefslogtreecommitdiff
path: root/rust/library.go
diff options
context:
space:
mode:
author Ivan Lozano <ivanlozano@google.com> 2025-02-20 06:23:41 -0800
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2025-02-20 06:23:41 -0800
commitdbcf9da57530287ff53aa5707bda1262c4cd2769 (patch)
tree8d5c2634d25363fb7fd002e83d077683f6bf929e /rust/library.go
parent0a8763cdcd0e8a990c040fce5b72c720362fc5e2 (diff)
parent610eb1a1e299206cb59c0a4a7bc6ce05a028d537 (diff)
Merge "rust: Propagate MTO libs linked whole through dylibs." into main
Diffstat (limited to 'rust/library.go')
-rw-r--r--rust/library.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/rust/library.go b/rust/library.go
index 7f5861fe8..415785a16 100644
--- a/rust/library.go
+++ b/rust/library.go
@@ -744,10 +744,16 @@ func (library *libraryDecorator) compile(ctx ModuleContext, flags Flags, deps Pa
}
if library.rlib() {
ccExporter.RustRlibDeps = append(ccExporter.RustRlibDeps, deps.reexportedCcRlibDeps...)
+ ccExporter.RustRlibDeps = append(ccExporter.RustRlibDeps, deps.reexportedWholeCcRlibDeps...)
}
android.SetProvider(ctx, cc.FlagExporterInfoProvider, ccExporter)
}
+ if library.dylib() {
+ // reexport whole-static'd dependencies for dylibs.
+ library.flagExporter.wholeRustRlibDeps = append(library.flagExporter.wholeRustRlibDeps, deps.reexportedWholeCcRlibDeps...)
+ }
+
if library.shared() || library.stubs() {
// Optimize out relinking against shared libraries whose interface hasn't changed by
// depending on a table of contents file instead of the library itself.