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

Commit 80850d86 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Fix the ABI dump directory name for vendor libraries"

parents 067e62e4 a90bd389
Loading
Loading
Loading
Loading
+18 −19
Original line number Original line Diff line number Diff line
@@ -1875,25 +1875,21 @@ func prevDumpRefVersion(ctx ModuleContext) int {
	}
	}
}
}


func (library *libraryDecorator) linkSAbiDumpFiles(ctx ModuleContext, objs Objects, fileName string, soFile android.Path) {
func currRefAbiDumpVersion(ctx ModuleContext, isVndk bool) string {
	if library.sabi.shouldCreateSourceAbiDump() {
	if isVndk {
		var version string
		// Each version of VNDK is independent, so follow the VNDK version which is the codename or PLATFORM_SDK_VERSION.
		var prevVersion int
		return ctx.Module().(*Module).VndkVersion()

	} else if ctx.Config().PlatformSdkFinal() {
		if ctx.useVndk() {
		// After sdk finalization, the ABI of the latest API level must be consistent with the source code,
			// For modules linking against vndk, follow its vndk version
		// so choose PLATFORM_SDK_VERSION as the current version.
			version = ctx.Module().(*Module).VndkVersion()
		return ctx.Config().PlatformSdkVersion().String()
		} else {
			// After sdk finalizatoin, the ABI of the latest API level must be consistent with the source code
			// so the chosen reference dump is the PLATFORM_SDK_VERSION.
			if ctx.Config().PlatformSdkFinal() {
				version = ctx.Config().PlatformSdkVersion().String()
	} else {
	} else {
				version = "current"
		return "current"
	}
	}
			prevVersion = prevDumpRefVersion(ctx)
}
}


func (library *libraryDecorator) linkSAbiDumpFiles(ctx ModuleContext, objs Objects, fileName string, soFile android.Path) {
	if library.sabi.shouldCreateSourceAbiDump() {
		exportIncludeDirs := library.flagExporter.exportedIncludes(ctx)
		exportIncludeDirs := library.flagExporter.exportedIncludes(ctx)
		var SourceAbiFlags []string
		var SourceAbiFlags []string
		for _, dir := range exportIncludeDirs.Strings() {
		for _, dir := range exportIncludeDirs.Strings() {
@@ -1910,10 +1906,12 @@ func (library *libraryDecorator) linkSAbiDumpFiles(ctx ModuleContext, objs Objec


		addLsdumpPath(classifySourceAbiDump(ctx) + ":" + library.sAbiOutputFile.String())
		addLsdumpPath(classifySourceAbiDump(ctx) + ":" + library.sAbiOutputFile.String())


		isVndk := ctx.useVndk() && ctx.isVndk()
		isNdk := ctx.isNdk(ctx.Config())
		isNdk := ctx.isNdk(ctx.Config())
		isLlndk := ctx.isImplementationForLLNDKPublic()
		isLlndk := ctx.isImplementationForLLNDKPublic()
		// If NDK or PLATFORM library, check against previous version ABI.
		// If NDK or PLATFORM library, check against previous version ABI.
		if !ctx.useVndk() {
		if !isVndk {
			prevVersion := prevDumpRefVersion(ctx)
			prevRefAbiDumpFile := getRefAbiDumpFile(ctx, strconv.Itoa(prevVersion), fileName)
			prevRefAbiDumpFile := getRefAbiDumpFile(ctx, strconv.Itoa(prevVersion), fileName)
			if prevRefAbiDumpFile != nil {
			if prevRefAbiDumpFile != nil {
				library.prevSAbiDiff = sourceAbiDiff(ctx, library.sAbiOutputFile.Path(),
				library.prevSAbiDiff = sourceAbiDiff(ctx, library.sAbiOutputFile.Path(),
@@ -1924,7 +1922,8 @@ func (library *libraryDecorator) linkSAbiDumpFiles(ctx ModuleContext, objs Objec
			}
			}
		}
		}


		refAbiDumpFile := getRefAbiDumpFile(ctx, version, fileName)
		currVersion := currRefAbiDumpVersion(ctx, isVndk)
		refAbiDumpFile := getRefAbiDumpFile(ctx, currVersion, fileName)
		if refAbiDumpFile != nil {
		if refAbiDumpFile != nil {
			library.sAbiDiff = sourceAbiDiff(ctx, library.sAbiOutputFile.Path(),
			library.sAbiDiff = sourceAbiDiff(ctx, library.sAbiOutputFile.Path(),
				refAbiDumpFile, fileName,
				refAbiDumpFile, fileName,