Merge "Fix the condition for LLNDK ABI diff"

This commit is contained in:
Hsin-Yi Chen
2022-11-11 06:02:09 +00:00
committed by Gerrit Code Review
2 changed files with 10 additions and 8 deletions

View File

@@ -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 {

View File

@@ -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)
}
}
}