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

Commit dccddb60 authored by Hsin-Yi Chen's avatar Hsin-Yi Chen
Browse files

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
parent 5d069fb8
Loading
Loading
Loading
Loading
+2 −13
Original line number Diff line number Diff line
@@ -964,7 +964,6 @@ func sourceAbiDiff(ctx android.ModuleContext, inputDump android.Path, referenceD

	outputFile := android.PathForModuleOut(ctx, baseName+".abidiff")
	libName := strings.TrimSuffix(baseName, filepath.Ext(baseName))
	createReferenceDumpFlags := ""

	var extraFlags []string
	if checkAllApis {
@@ -975,19 +974,9 @@ func sourceAbiDiff(ctx android.ModuleContext, inputDump android.Path, referenceD
			"-allow-unreferenced-elf-symbol-changes")
	}

	if exportedHeaderFlags == "" {
		extraFlags = append(extraFlags, "-advice-only")
	}

	if isLlndk || isNdk {
		createReferenceDumpFlags = "--llndk"
		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 {
		extraFlags = append(extraFlags, "-allow-extensions")
	}
@@ -1005,7 +994,7 @@ func sourceAbiDiff(ctx android.ModuleContext, inputDump android.Path, referenceD
			"libName":                  libName,
			"arch":                     ctx.Arch().ArchType.Name,
			"extraFlags":               strings.Join(extraFlags, " "),
			"createReferenceDumpFlags": createReferenceDumpFlags,
			"createReferenceDumpFlags": "",
		},
	})
	return android.OptionalPathForPath(outputFile)