LLNDK libraries can also provide libraries
Current linker.config.pb puts libraries into the provide library list
only if the library is stub (or defines stub). However, there are some
LLNDK libraries which does not define stub, thus would be ignored from
the providing libs list. This change adds libraries into the providing
libs list if the library is LLNDK.
Bug: 351227576
Test: linker.config.pb from aosp_cf_system_x86_64 contains LLNDK
libraries as providing libs
Change-Id: I23c02c9d05a5176dab34fe792029d6236790be56
diff --git a/linkerconfig/linkerconfig.go b/linkerconfig/linkerconfig.go
index 3a8d3cf..87c0814 100644
--- a/linkerconfig/linkerconfig.go
+++ b/linkerconfig/linkerconfig.go
@@ -104,7 +104,7 @@
// Secondly, if there's provideLibs gathered from provideModules, append them
var provideLibs []string
for _, m := range provideModules {
- if c, ok := m.(*cc.Module); ok && cc.IsStubTarget(c) {
+ if c, ok := m.(*cc.Module); ok && (cc.IsStubTarget(c) || c.HasLlndkStubs()) {
for _, ps := range c.PackagingSpecs() {
provideLibs = append(provideLibs, ps.FileName())
}