diff options
author | 2025-02-12 21:36:49 +0000 | |
---|---|---|
committer | 2025-02-19 17:39:32 +0000 | |
commit | 610eb1a1e299206cb59c0a4a7bc6ce05a028d537 (patch) | |
tree | bb402a5bd52150f9768841289f9db201e42dcf89 /rust/library.go | |
parent | 14b1c563d1347c14a96cf1d14753f1276028586d (diff) |
rust: Propagate MTO libs linked whole through dylibs.
Because dylibs don't export symbols of whole-archive staticlibs, we
simulate this by propagating those static libs through to dependent
modules. Similarly, we must do the same for rlibs from cc_* modules used
to generate MTO staticlibs.
Bug: 395915782
Test: New soong tests
Test: m rust
Change-Id: I83d6a08234af04af5039764f5a80f659b24aa132
Diffstat (limited to 'rust/library.go')
-rw-r--r-- | rust/library.go | 6 |
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. |