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

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

Merge "Fix the condition for LLNDK ABI diff"

parents 877336cc 7584bda2
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -924,9 +924,9 @@ func unzipRefDump(ctx android.ModuleContext, zippedRefDump android.Path, baseNam
}

// sourceAbiDiff registers a build statement to compare linked sAbi dump files (.lsdump).
func sourceAbiDiff(ctx android.ModuleContext, inputDump android.Path, referenceDump android.Path,
	baseName, exportedHeaderFlags string, diffFlags []string, prevVersion int,
	checkAllApis, isLlndk, isNdk, isVndkExt, previousVersionDiff bool) android.OptionalPath {
func sourceAbiDiff(ctx android.ModuleContext, inputDump, referenceDump android.Path,
	baseName string, diffFlags []string, prevVersion int,
	checkAllApis, isLlndkOrNdk, isVndkExt, previousVersionDiff bool) android.OptionalPath {

	var outputFile android.ModuleOutPath
	if previousVersionDiff {
@@ -955,7 +955,7 @@ func sourceAbiDiff(ctx android.ModuleContext, inputDump android.Path, referenceD
		extraFlags = append(extraFlags, "-target-version", "current")
	}

	if isLlndk || isNdk {
	if isLlndkOrNdk {
		extraFlags = append(extraFlags, "-consider-opaque-types-different")
	}
	if isVndkExt || previousVersionDiff {
+6 −4
Original line number Diff line number Diff line
@@ -1910,26 +1910,28 @@ func (library *libraryDecorator) linkSAbiDumpFiles(ctx ModuleContext, objs Objec

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

		isNdk := ctx.isNdk(ctx.Config())
		isLlndk := ctx.isImplementationForLLNDKPublic()
		// If NDK or PLATFORM library, check against previous version ABI.
		if !ctx.useVndk() {
			prevRefAbiDumpFile := getRefAbiDumpFile(ctx, strconv.Itoa(prevVersion), fileName)
			if prevRefAbiDumpFile != nil {
				library.prevSAbiDiff = sourceAbiDiff(ctx, library.sAbiOutputFile.Path(),
					prevRefAbiDumpFile, fileName, exportedHeaderFlags,
					prevRefAbiDumpFile, fileName,
					library.Properties.Header_abi_checker.Diff_flags, prevVersion,
					Bool(library.Properties.Header_abi_checker.Check_all_apis),
					ctx.IsLlndk(), ctx.isNdk(ctx.Config()), ctx.IsVndkExt(), true)
					isLlndk || isNdk, ctx.IsVndkExt(), true)
			}
		}

		refAbiDumpFile := getRefAbiDumpFile(ctx, version, fileName)
		if refAbiDumpFile != nil {
			library.sAbiDiff = sourceAbiDiff(ctx, library.sAbiOutputFile.Path(),
				refAbiDumpFile, fileName, exportedHeaderFlags,
				refAbiDumpFile, fileName,
				library.Properties.Header_abi_checker.Diff_flags,
				/* unused if not previousVersionDiff */ 0,
				Bool(library.Properties.Header_abi_checker.Check_all_apis),
				ctx.IsLlndk(), ctx.isNdk(ctx.Config()), ctx.IsVndkExt(), false)
				isLlndk || isNdk, ctx.IsVndkExt(), false)
		}
	}
}