aboutsummaryrefslogtreecommitdiff
path: root/cc/sabi.go
diff options
context:
space:
mode:
authorHsin-Yi Chen <hsinyichen@google.com>2024-01-05 14:41:06 +0800
committerHsin-Yi Chen <hsinyichen@google.com>2024-01-31 11:21:13 +0000
commit50884dce3c21decd6491cef231a7723dd266b104 (patch)
treea213517b3f089569ccf46aa59c3ad01ce53b1ffe /cc/sabi.go
parent73b1b48d9bcbdf054980dab0224c5546a6209923 (diff)
downloadsoong-50884dce3c21decd6491cef231a7723dd266b104.tar.gz
Separate LLNDK from the platform library dumps
LLNDK will not be finalized at the same time with NDK and APEX libraries. The ABI dumps need to be generated and stored separately. In lsdump_paths.txt, each dump path is tagged with LLNDK, NDK, etc. A library may have multiple dumps with different tags. The finalization scripts will read lsdump_paths.txt and select the dumps for LLNDK. LLNDK versioning for trunk stable has not been implemented. Currently the dumps for LLNDK, APEX, NDK are identical. Bug: 314010764 Test: make out/target/product/generic_x86_64/lsdump_paths.txt Change-Id: Ia8eed555dc176b221e67b3b049dd3db76f9bc658
Diffstat (limited to 'cc/sabi.go')
-rw-r--r--cc/sabi.go34
1 files changed, 16 insertions, 18 deletions
diff --git a/cc/sabi.go b/cc/sabi.go
index 9f5781fa9..4ca9f5c6e 100644
--- a/cc/sabi.go
+++ b/cc/sabi.go
@@ -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