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
diff --git a/android/sh_binary.go b/android/sh_binary.go
index 6db9892..2b649c4 100644
--- a/android/sh_binary.go
+++ b/android/sh_binary.go
@@ -196,6 +196,9 @@
// executable binary to <partition>/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