For abi diffing, factor in arch variant and primary arch.

binder_size_t has a different size for builds with different primary
arches.

Also maintain seperate reference dumps for different arch variants,
since different cflags may be legally specified for them (similar to
what GSI does)

Test: create reference dump for libjpeg at
      prebuilts/abi-dumps/vndk/current/arm64/arm64_armv8-a/source-based/libjpeg.so.lsdump.gz
      mm -j64; header-abi-diff gets invoked.

Change-Id: I55eae4d4811c9754fe8dbd1009c7929fea119eeb
This commit is contained in:
Jayant Chowdhary 2018-02-20 10:53:31 -08:00
parent 540a78c1ce
commit ac066c6b90
1 changed files with 12 additions and 3 deletions

View File

@ -776,7 +776,12 @@ func pathForModule(ctx ModuleContext) OutputPath {
// PathForVndkRefDump returns an OptionalPath representing the path of the reference
// abi dump for the given module. This is not guaranteed to be valid.
func PathForVndkRefAbiDump(ctx ModuleContext, version, fileName string, vndkOrNdk, isSourceDump bool) OptionalPath {
archName := ctx.Arch().ArchType.Name
arches := ctx.DeviceConfig().Arches()
currentArch := ctx.Arch()
archNameAndVariant := currentArch.ArchType.String()
if currentArch.ArchVariant != "" {
archNameAndVariant += "_" + currentArch.ArchVariant
}
var sourceOrBinaryDir string
var vndkOrNdkDir string
var ext string
@ -792,8 +797,12 @@ func PathForVndkRefAbiDump(ctx ModuleContext, version, fileName string, vndkOrNd
} else {
vndkOrNdkDir = "ndk"
}
refDumpFileStr := "prebuilts/abi-dumps/" + vndkOrNdkDir + "/" + version + "/" +
archName + "/" + sourceOrBinaryDir + "/" + fileName + ext
if len(arches) == 0 {
panic("device build with no primary arch")
}
primary_arch := arches[0].ArchType.String()
refDumpFileStr := "prebuilts/abi-dumps/" + vndkOrNdkDir + "/" + version + "/" + primary_arch + "/" +
archNameAndVariant + "/" + sourceOrBinaryDir + "/" + fileName + ext
return ExistentPathForSource(ctx, refDumpFileStr)
}