From 6ac3cac7d14b631205408cda317a882592fafe2e Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Tue, 19 Nov 2019 12:57:57 +0900 Subject: [PATCH] sh_binary prefer 32bit when TARGET_PREFER_32_BIT The module type can be referenced in the 'binaries' property of an APEX, where it is expected that the binary modules prefer 32bit arch when the build is configured with TARGET_PREFER_32_BIT. Satisfying the expectation by allowing the module types to use 32bit arch in the case. Bug: 144532908 Test: choosecombo 1 aosp_arm64 userdebug; TARGET_PREFER_32_BIT=true m; Change-Id: I2120b40e3230aa695b4c38b850c1ea32e46cbbfb --- android/sh_binary.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/android/sh_binary.go b/android/sh_binary.go index 6db9892fa..2b649c4a2 100644 --- a/android/sh_binary.go +++ b/android/sh_binary.go @@ -196,6 +196,9 @@ func InitShBinaryModule(s *ShBinary) { // executable binary to /bin. func ShBinaryFactory() Module { module := &ShBinary{} + module.Prefer32(func(ctx BaseModuleContext, base *ModuleBase, class OsClass) bool { + return class == Device && ctx.Config().DevicePrefer32BitExecutables() + }) InitShBinaryModule(module) InitAndroidArchModule(module, HostAndDeviceSupported, MultilibFirst) return module