Fix llndk_library init
llndk_library modules were not calling module.Init(), which caused them
not to register ModuleBase.VendorProperties. Unregistered property
structs lose their values during cloning, which caused the shared
variants of llndk_library modules to not have IsLLNDK set.
Call module.Init(), which registers ModuleBase.VendorProperties. Also
add a helper function to filter out llndk_library modules that now
show up in the list of modules with IsLLNDK set.
Bug: 170784825
Test: m checkbuild
Change-Id: Iafde85f6a95e85a618f6f7d7a210398febb6b158
diff --git a/cc/library.go b/cc/library.go
index 1185385..bc6ff69 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -1738,12 +1738,9 @@
isLLNDK := false
if m, ok := mctx.Module().(*Module); ok {
- isLLNDK = m.IsLlndk()
// Don't count the vestigial llndk_library module as isLLNDK, it needs a static
// variant so that a cc_library_prebuilt can depend on it.
- if _, ok := m.linker.(*llndkStubDecorator); ok {
- isLLNDK = false
- }
+ isLLNDK = m.IsLlndk() && !isVestigialLLNDKModule(m)
}
buildStatic := library.BuildStaticVariant() && !isLLNDK
buildShared := library.BuildSharedVariant()