Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 50884dce authored by Hsin-Yi Chen's avatar Hsin-Yi Chen
Browse files

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
parent 73b1b48d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1476,7 +1476,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()
+16 −18
Original line number Diff line number Diff line
@@ -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"
		}
		if m.library.hasStubsVariants() {
			return "PLATFORM"
			result = append(result, "LLNDK")
		}
		// 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