Merge "Separate LLNDK from the platform library dumps" into main

This commit is contained in:
Hsin-Yi Chen
2024-02-02 04:34:50 +00:00
committed by Gerrit Code Review
2 changed files with 19 additions and 19 deletions

View File

@@ -1480,7 +1480,9 @@ func (library *libraryDecorator) linkSAbiDumpFiles(ctx ModuleContext, objs Objec
headerAbiChecker.Exclude_symbol_tags,
currVersion)
addLsdumpPath(classifySourceAbiDump(ctx) + ":" + library.sAbiOutputFile.String())
for _, tag := range classifySourceAbiDump(ctx) {
addLsdumpPath(tag + ":" + library.sAbiOutputFile.String())
}
dumpDir := getRefAbiDumpDir(isNdk, isLlndk)
binderBitness := ctx.DeviceConfig().BinderBitness()

View File

@@ -97,36 +97,34 @@ func (sabi *sabi) shouldCreateSourceAbiDump() bool {
return sabi != nil && sabi.Properties.ShouldCreateSourceAbiDump
}
// Returns a string that represents the class of the ABI dump.
// Returns an empty string if ABI check is disabled for this library.
func classifySourceAbiDump(ctx android.BaseModuleContext) string {
// Returns a slice of strings that represent the ABI dumps generated for this module.
func classifySourceAbiDump(ctx android.BaseModuleContext) []string {
result := []string{}
m := ctx.Module().(*Module)
headerAbiChecker := m.library.getHeaderAbiCheckerProperties(ctx)
if headerAbiChecker.explicitlyDisabled() {
return ""
return result
}
if !m.InProduct() && !m.InVendor() {
// Return NDK if the library is both NDK and LLNDK.
if m.IsNdk(ctx.Config()) {
return "NDK"
}
if m.isImplementationForLLNDKPublic() {
return "LLNDK"
result = append(result, "LLNDK")
}
if m.library.hasStubsVariants() {
return "PLATFORM"
// Return NDK if the library is both NDK and APEX.
// TODO(b/309880485): Split NDK and APEX ABI.
if m.IsNdk(ctx.Config()) {
result = append(result, "NDK")
} else if m.library.hasStubsVariants() || headerAbiChecker.enabled() {
result = append(result, "PLATFORM")
}
}
if headerAbiChecker.enabled() {
} else if headerAbiChecker.enabled() {
if m.InProduct() {
return "PRODUCT"
result = append(result, "PRODUCT")
}
if m.InVendor() {
return "VENDOR"
result = append(result, "VENDOR")
}
return "PLATFORM"
}
return ""
return result
}
// Called from sabiDepsMutator to check whether ABI dumps should be created for this module.
@@ -195,7 +193,7 @@ func shouldCreateSourceAbiDumpForLibrary(ctx android.BaseModuleContext) bool {
return false
}
}
return classifySourceAbiDump(ctx) != ""
return len(classifySourceAbiDump(ctx)) > 0
}
// Mark the direct and transitive dependencies of libraries that need ABI check, so that ABI dumps