From 34ce67d454038e1d8b11e45c9676f2229fd3e21a Mon Sep 17 00:00:00 2001 From: Jayant Chowdhary Date: Thu, 8 Mar 2018 11:00:50 -0800 Subject: [PATCH] Consider binder bitness while looking for abi references. Binder bitness does not always correlate directly with primary arch, as assumed earlier. For example: it is possible to have devices with primary arch 'arm' and use 64 bit binder. Bug: 74362434 Test: utils/create_reference_dumps.py; m -j vndk_package for aosp_arm64_ab, aosp_arm_ab invokes header-abi-diff on both arm and arm64 arches. Test: mm -j64 in system/libhwbinder on troublesome internal target. Change-Id: Iea0a24b57cdb3033e25b6fe126c5d5d717f45b4e --- android/config.go | 8 ++++++++ android/paths.go | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/android/config.go b/android/config.go index b158e0516..db833eca7 100644 --- a/android/config.go +++ b/android/config.go @@ -649,6 +649,14 @@ func (c *deviceConfig) Arches() []Arch { return arches } +func (c *deviceConfig) BinderBitness() string { + is32BitBinder := c.config.ProductVariables.Binder32bit + if is32BitBinder != nil && *is32BitBinder { + return "32" + } + return "64" +} + func (c *deviceConfig) VendorPath() string { if c.config.ProductVariables.VendorPath != nil { return *c.config.ProductVariables.VendorPath diff --git a/android/paths.go b/android/paths.go index cf5544df4..3605dcf42 100644 --- a/android/paths.go +++ b/android/paths.go @@ -800,8 +800,8 @@ func PathForVndkRefAbiDump(ctx ModuleContext, version, fileName string, vndkOrNd 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 + "/" + + binderBitness := ctx.DeviceConfig().BinderBitness() + refDumpFileStr := "prebuilts/abi-dumps/" + vndkOrNdkDir + "/" + version + "/" + binderBitness + "/" + archNameAndVariant + "/" + sourceOrBinaryDir + "/" + fileName + ext return ExistentPathForSource(ctx, refDumpFileStr) }