Remove unneeded logic from sourceAbiDiff

- The script creating reference dumps does not need --llndk. It can
  determine the library types automatically.
- NDK passes the ABI checks with -consider-opaque-types-different.
- All libraries checked by the ABI tools have exported headers and don't
  need -advice-only.

Bug: 232891473
Test: development/vndk/tools/header-checker/utils/create_reference_dumps.py \
      && make
Change-Id: Ia418022d6d0b46bfabefaa296fa81e80291fde32
This commit is contained in:
Hsin-Yi Chen
2022-06-02 14:24:16 +08:00
parent 5d069fb876
commit dccddb6036

View File

@@ -964,7 +964,6 @@ func sourceAbiDiff(ctx android.ModuleContext, inputDump android.Path, referenceD
outputFile := android.PathForModuleOut(ctx, baseName+".abidiff") outputFile := android.PathForModuleOut(ctx, baseName+".abidiff")
libName := strings.TrimSuffix(baseName, filepath.Ext(baseName)) libName := strings.TrimSuffix(baseName, filepath.Ext(baseName))
createReferenceDumpFlags := ""
var extraFlags []string var extraFlags []string
if checkAllApis { if checkAllApis {
@@ -975,18 +974,8 @@ func sourceAbiDiff(ctx android.ModuleContext, inputDump android.Path, referenceD
"-allow-unreferenced-elf-symbol-changes") "-allow-unreferenced-elf-symbol-changes")
} }
if exportedHeaderFlags == "" {
extraFlags = append(extraFlags, "-advice-only")
}
if isLlndk || isNdk { if isLlndk || isNdk {
createReferenceDumpFlags = "--llndk" extraFlags = append(extraFlags, "-consider-opaque-types-different")
if isLlndk {
// TODO(b/130324828): "-consider-opaque-types-different" should apply to
// both LLNDK and NDK shared libs. However, a known issue in header-abi-diff
// breaks libaaudio. Remove the if-guard after the issue is fixed.
extraFlags = append(extraFlags, "-consider-opaque-types-different")
}
} }
if isVndkExt { if isVndkExt {
extraFlags = append(extraFlags, "-allow-extensions") extraFlags = append(extraFlags, "-allow-extensions")
@@ -1005,7 +994,7 @@ func sourceAbiDiff(ctx android.ModuleContext, inputDump android.Path, referenceD
"libName": libName, "libName": libName,
"arch": ctx.Arch().ArchType.Name, "arch": ctx.Arch().ArchType.Name,
"extraFlags": strings.Join(extraFlags, " "), "extraFlags": strings.Join(extraFlags, " "),
"createReferenceDumpFlags": createReferenceDumpFlags, "createReferenceDumpFlags": "",
}, },
}) })
return android.OptionalPathForPath(outputFile) return android.OptionalPathForPath(outputFile)