diff options
author | 2024-01-08 18:38:42 +0800 | |
---|---|---|
committer | 2024-01-09 12:58:16 +0800 | |
commit | 27bafd02e0c7f17bcbdb1d6bdfd77a8cc6b5b332 (patch) | |
tree | 12e97317b98032609e4987292acc37608352078e | |
parent | 0f5162161d14a07b6132c33fef8d35d937cbd514 (diff) |
Do not build ABI dumps for VNDK
Since VNDK in the main branch will not be finalized, this commit
deletes the build rules that generate the ABI dumps.
Test: make
Bug: 314010764
Change-Id: I2bbab7612d8cbc27312dc4a3c47a0592177918d8
-rw-r--r-- | cc/library.go | 42 | ||||
-rw-r--r-- | cc/sabi.go | 33 |
2 files changed, 27 insertions, 48 deletions
diff --git a/cc/library.go b/cc/library.go index 592f70f47..9e44f186a 100644 --- a/cc/library.go +++ b/cc/library.go @@ -1342,12 +1342,10 @@ func getRefAbiDumpFile(ctx android.ModuleInstallPathContext, fileName+".lsdump") } -func getRefAbiDumpDir(isNdk, isVndk bool) string { +func getRefAbiDumpDir(isNdk bool) string { var dirName string if isNdk { dirName = "ndk" - } else if isVndk { - dirName = "vndk" } else { dirName = "platform" } @@ -1373,11 +1371,8 @@ func prevRefAbiDumpVersion(ctx ModuleContext, dumpDir string) int { } } -func currRefAbiDumpVersion(ctx ModuleContext, isVndk bool) string { - if isVndk { - // Each version of VNDK is independent, so follow the VNDK version which is the codename or PLATFORM_SDK_VERSION. - return ctx.Module().(*Module).VndkVersion() - } else if ctx.Config().PlatformSdkFinal() { +func currRefAbiDumpVersion(ctx ModuleContext) string { + if ctx.Config().PlatformSdkFinal() { // After sdk finalization, the ABI of the latest API level must be consistent with the source code, // so choose PLATFORM_SDK_VERSION as the current version. return ctx.Config().PlatformSdkVersion().String() @@ -1426,13 +1421,13 @@ func (library *libraryDecorator) crossVersionAbiDiff(ctx android.ModuleContext, } func (library *libraryDecorator) sameVersionAbiDiff(ctx android.ModuleContext, referenceDump android.Path, - baseName string, isLlndkOrNdk, allowExtensions bool) { + baseName string, isLlndkOrNdk bool) { libName := strings.TrimSuffix(baseName, filepath.Ext(baseName)) errorMessage := "error: Please update ABI references with: $$ANDROID_BUILD_TOP/development/vndk/tools/header-checker/utils/create_reference_dumps.py -l " + libName library.sourceAbiDiff(ctx, referenceDump, baseName, "", - isLlndkOrNdk, allowExtensions, "current", errorMessage) + isLlndkOrNdk, false /* allowExtensions */, "current", errorMessage) } func (library *libraryDecorator) optInAbiDiff(ctx android.ModuleContext, referenceDump android.Path, @@ -1462,10 +1457,9 @@ func (library *libraryDecorator) linkSAbiDumpFiles(ctx ModuleContext, objs Objec exportedHeaderFlags := strings.Join(SourceAbiFlags, " ") headerAbiChecker := library.getHeaderAbiCheckerProperties(ctx) // The logic must be consistent with classifySourceAbiDump. - isVndk := ctx.useVndk() && ctx.isVndk() isNdk := ctx.isNdk(ctx.Config()) isLlndk := ctx.isImplementationForLLNDKPublic() - currVersion := currRefAbiDumpVersion(ctx, isVndk) + currVersion := currRefAbiDumpVersion(ctx) library.sAbiOutputFile = transformDumpToLinkedDump(ctx, objs.sAbiDumpFiles, soFile, fileName, exportedHeaderFlags, android.OptionalPathForModuleSrc(ctx, library.symbolFileForAbiCheck(ctx)), headerAbiChecker.Exclude_symbol_versions, @@ -1474,26 +1468,24 @@ func (library *libraryDecorator) linkSAbiDumpFiles(ctx ModuleContext, objs Objec addLsdumpPath(classifySourceAbiDump(ctx) + ":" + library.sAbiOutputFile.String()) - dumpDir := getRefAbiDumpDir(isNdk, isVndk) + dumpDir := getRefAbiDumpDir(isNdk) binderBitness := ctx.DeviceConfig().BinderBitness() - // If NDK or PLATFORM library, check against previous version ABI. - if !isVndk { - prevVersionInt := prevRefAbiDumpVersion(ctx, dumpDir) - prevVersion := strconv.Itoa(prevVersionInt) - prevDumpDir := filepath.Join(dumpDir, prevVersion, binderBitness) - prevDumpFile := getRefAbiDumpFile(ctx, prevDumpDir, fileName) - if prevDumpFile.Valid() { - library.crossVersionAbiDiff(ctx, prevDumpFile.Path(), - fileName, isLlndk || isNdk, - strconv.Itoa(prevVersionInt+1), prevVersion) - } + // Check against the previous version. + prevVersionInt := prevRefAbiDumpVersion(ctx, dumpDir) + prevVersion := strconv.Itoa(prevVersionInt) + prevDumpDir := filepath.Join(dumpDir, prevVersion, binderBitness) + prevDumpFile := getRefAbiDumpFile(ctx, prevDumpDir, fileName) + if prevDumpFile.Valid() { + library.crossVersionAbiDiff(ctx, prevDumpFile.Path(), + fileName, isLlndk || isNdk, + strconv.Itoa(prevVersionInt+1), prevVersion) } // Check against the current version. currDumpDir := filepath.Join(dumpDir, currVersion, binderBitness) currDumpFile := getRefAbiDumpFile(ctx, currDumpDir, fileName) if currDumpFile.Valid() { library.sameVersionAbiDiff(ctx, currDumpFile.Path(), - fileName, isLlndk || isNdk, ctx.IsVndkExt()) + fileName, isLlndk || isNdk) } // Check against the opt-in reference dumps. for i, optInDumpDir := range headerAbiChecker.Ref_dump_dirs { diff --git a/cc/sabi.go b/cc/sabi.go index 13106859f..9f5781fa9 100644 --- a/cc/sabi.go +++ b/cc/sabi.go @@ -105,30 +105,17 @@ func classifySourceAbiDump(ctx android.BaseModuleContext) string { if headerAbiChecker.explicitlyDisabled() { return "" } - // Return NDK if the library is both NDK and LLNDK. - if m.IsNdk(ctx.Config()) { - return "NDK" - } - if m.isImplementationForLLNDKPublic() { - return "LLNDK" - } - if m.UseVndk() && m.IsVndk() && !m.IsVndkPrivate() { - if m.IsVndkSp() { - if m.IsVndkExt() { - return "VNDK-SP-ext" - } else { - return "VNDK-SP" - } - } else { - if m.IsVndkExt() { - return "VNDK-ext" - } else { - return "VNDK-core" - } + 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" } - } - if m.library.hasStubsVariants() && !m.InProduct() && !m.InVendor() { - return "PLATFORM" } if headerAbiChecker.enabled() { if m.InProduct() { |