From ac066c6b9025a5beac9b003181b9aba6d0e51918 Mon Sep 17 00:00:00 2001 From: Jayant Chowdhary Date: Tue, 20 Feb 2018 10:53:31 -0800 Subject: [PATCH] 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 --- android/paths.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/android/paths.go b/android/paths.go index ffdb39354..cf5544df4 100644 --- a/android/paths.go +++ b/android/paths.go @@ -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) }