Disable header ABI checker for NDK
NDK team requested not to generate the dumps by header ABI checker in
the finalization process.
Test: m out/target/product/generic_arm64/lsdump_paths.txt
Bug: 332959609
Change-Id: Ia04c6f266088968ff731c0fabbbfce26300109ae
diff --git a/cc/library.go b/cc/library.go
index a436649..12ecc13 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -1322,7 +1322,7 @@
// sourceAbiDiff registers a build statement to compare linked sAbi dump files (.lsdump).
func (library *libraryDecorator) sourceAbiDiff(ctx android.ModuleContext,
sourceDump, referenceDump android.Path,
- baseName, nameExt string, isLlndkOrNdk, allowExtensions bool,
+ baseName, nameExt string, isLlndk, allowExtensions bool,
sourceVersion, errorMessage string) {
extraFlags := []string{"-target-version", sourceVersion}
@@ -1334,7 +1334,7 @@
"-allow-unreferenced-changes",
"-allow-unreferenced-elf-symbol-changes")
}
- if isLlndkOrNdk {
+ if isLlndk {
extraFlags = append(extraFlags, "-consider-opaque-types-different")
}
if allowExtensions {
@@ -1350,23 +1350,23 @@
func (library *libraryDecorator) crossVersionAbiDiff(ctx android.ModuleContext,
sourceDump, referenceDump android.Path,
- baseName string, isLlndkOrNdk bool, sourceVersion, prevVersion string) {
+ baseName string, isLlndk bool, sourceVersion, prevVersion string) {
errorMessage := "error: Please follow https://android.googlesource.com/platform/development/+/main/vndk/tools/header-checker/README.md#configure-cross_version-abi-check to resolve the ABI difference between your source code and version " + prevVersion + "."
library.sourceAbiDiff(ctx, sourceDump, referenceDump, baseName, prevVersion,
- isLlndkOrNdk, true /* allowExtensions */, sourceVersion, errorMessage)
+ isLlndk, true /* allowExtensions */, sourceVersion, errorMessage)
}
func (library *libraryDecorator) sameVersionAbiDiff(ctx android.ModuleContext,
sourceDump, referenceDump android.Path,
- baseName, nameExt string, isLlndkOrNdk bool) {
+ baseName, nameExt string, isLlndk 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, sourceDump, referenceDump, baseName, nameExt,
- isLlndkOrNdk, false /* allowExtensions */, "current", errorMessage)
+ isLlndk, false /* allowExtensions */, "current", errorMessage)
}
func (library *libraryDecorator) optInAbiDiff(ctx android.ModuleContext,
@@ -1381,7 +1381,7 @@
}
library.sourceAbiDiff(ctx, sourceDump, referenceDump, baseName, nameExt,
- false /* isLlndkOrNdk */, false /* allowExtensions */, "current", errorMessage)
+ false /* isLlndk */, false /* allowExtensions */, "current", errorMessage)
}
func (library *libraryDecorator) linkSAbiDumpFiles(ctx ModuleContext, deps PathDeps, objs Objects, fileName string, soFile android.Path) {
@@ -1436,7 +1436,6 @@
dumpDir := filepath.Join("prebuilts", "abi-dumps", dumpDirName)
isLlndk := (tag == llndkLsdumpTag)
isApex := (tag == apexLsdumpTag)
- isNdk := (tag == ndkLsdumpTag)
binderBitness := ctx.DeviceConfig().BinderBitness()
nameExt := ""
if isLlndk {
@@ -1468,7 +1467,7 @@
prevDumpFile := getRefAbiDumpFile(ctx, prevDumpDir, fileName)
if prevDumpFile.Valid() {
library.crossVersionAbiDiff(ctx, sourceDump, prevDumpFile.Path(),
- fileName, isLlndk || isNdk, currVersion, nameExt+prevVersion)
+ fileName, isLlndk, currVersion, nameExt+prevVersion)
}
// Check against the current version.
sourceDump = implDump
@@ -1488,7 +1487,7 @@
currDumpFile := getRefAbiDumpFile(ctx, currDumpDir, fileName)
if currDumpFile.Valid() {
library.sameVersionAbiDiff(ctx, sourceDump, currDumpFile.Path(),
- fileName, nameExt, isLlndk || isNdk)
+ fileName, nameExt, isLlndk)
}
}
// Check against the opt-in reference dumps.
diff --git a/cc/sabi.go b/cc/sabi.go
index cd9bf63..edd9cfe 100644
--- a/cc/sabi.go
+++ b/cc/sabi.go
@@ -31,7 +31,6 @@
const (
apexLsdumpTag lsdumpTag = "APEX"
llndkLsdumpTag lsdumpTag = "LLNDK"
- ndkLsdumpTag lsdumpTag = "NDK"
platformLsdumpTag lsdumpTag = "PLATFORM"
productLsdumpTag lsdumpTag = "PRODUCT"
vendorLsdumpTag lsdumpTag = "VENDOR"
@@ -42,8 +41,6 @@
switch *tag {
case apexLsdumpTag:
return "platform"
- case ndkLsdumpTag:
- return "ndk"
case llndkLsdumpTag:
return "vndk"
case platformLsdumpTag:
@@ -137,9 +134,6 @@
if m.isImplementationForLLNDKPublic() {
result = append(result, llndkLsdumpTag)
}
- if m.IsNdk(ctx.Config()) {
- result = append(result, ndkLsdumpTag)
- }
// APEX and opt-in platform dumps are placed in the same directory.
if m.library.hasStubsVariants() {
result = append(result, apexLsdumpTag)