aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiyong Park <jiyong@google.com>2018-07-07 18:02:07 +0900
committerJiyong Park <jiyong@google.com>2018-07-08 09:43:10 +0900
commit8d52f86bafb73cbef44e830222cd45607d7d2f46 (patch)
tree582fd4f644d81e8ed12aa712e3c95b706f2c78b8
parent17bef8f03494c7c364498c62de3ac1d30712d2e6 (diff)
downloadbuild_soong-8d52f86bafb73cbef44e830222cd45607d7d2f46.tar.gz
build_soong-8d52f86bafb73cbef44e830222cd45607d7d2f46.tar.bz2
build_soong-8d52f86bafb73cbef44e830222cd45607d7d2f46.zip
Fix: recovery module is disabled on 32-bit targets
Fixed a bug that recovery variant of a module is not created on 32-bit targets. The bug was happening because the creation of the recovery variant relied on DevicePrefer32BitExecutables() which returns false for 32-bit only targets. Now, recovery variant is checked against the primary architecture of the device that is returned by DevicePrimaryArchType(). Test: m -j adbd.recovery on aosp_arm and aosp_arm64 adbd is built under recovery/root/system/bin and it is ELF32 and ELF64, respectively for the targets. Test: m -j libc.recovery on aosp_arm, aosp_arm64, aosp_sailfish and the x86+arm target in mater. Only one libc.so is installed under recovery/root/system/lib (or lib64). Change-Id: I83a248d81f2c71dcfb0e9d887a75b71338f27b4d
-rw-r--r--android/config.go4
-rw-r--r--cc/cc.go22
2 files changed, 10 insertions, 16 deletions
diff --git a/android/config.go b/android/config.go
index 3a9b98b3..7ba05c1b 100644
--- a/android/config.go
+++ b/android/config.go
@@ -576,6 +576,10 @@ func (c *config) DevicePrefer32BitExecutables() bool {
return Bool(c.productVariables.DevicePrefer32BitExecutables)
}
+func (c *config) DevicePrimaryArchType() ArchType {
+ return c.Targets[Device][0].Arch.ArchType
+}
+
func (c *config) SkipDeviceInstall() bool {
return c.EmbeddedInMake()
}
diff --git a/cc/cc.go b/cc/cc.go
index 592f373a..8d050388 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -1570,14 +1570,9 @@ func imageMutator(mctx android.BottomUpMutatorContext) {
}
if recoveryVariantNeeded {
- var recoveryMultilib string
- if mctx.Config().DevicePrefer32BitExecutables() {
- recoveryMultilib = "lib32"
- } else {
- recoveryMultilib = "lib64"
- }
- multilib := genrule.Target().Arch.ArchType.Multilib
- if multilib != recoveryMultilib {
+ primaryArch := mctx.Config().DevicePrimaryArchType()
+ moduleArch := genrule.Target().Arch.ArchType
+ if moduleArch != primaryArch {
recoveryVariantNeeded = false
}
}
@@ -1690,14 +1685,9 @@ func imageMutator(mctx android.BottomUpMutatorContext) {
}
if recoveryVariantNeeded {
- var recoveryMultilib string
- if mctx.Config().DevicePrefer32BitExecutables() {
- recoveryMultilib = "lib32"
- } else {
- recoveryMultilib = "lib64"
- }
- multilib := m.Target().Arch.ArchType.Multilib
- if multilib != recoveryMultilib {
+ primaryArch := mctx.Config().DevicePrimaryArchType()
+ moduleArch := m.Target().Arch.ArchType
+ if moduleArch != primaryArch {
recoveryVariantNeeded = false
}
}