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

Commit c9d4eab9 authored by Hsin-Yi Chen's avatar Hsin-Yi Chen Committed by Gerrit Code Review
Browse files

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

parents d8cb9505 50884dce
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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()
+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