diff options
author | Jiyong Park <jiyong@google.com> | 2018-06-19 01:46:06 +0900 |
---|---|---|
committer | Jiyong Park <jiyong@google.com> | 2018-06-19 10:49:21 +0900 |
commit | 413cc744b8c45838895aa81f75d22f856ef99a9e (patch) | |
tree | f1af17a207f1f6935298bef5fc03636960f10250 /cc/cc.go | |
parent | f89db951e50ce18f5571d879865470795ec6d5e4 (diff) | |
download | build_soong-413cc744b8c45838895aa81f75d22f856ef99a9e.tar.gz build_soong-413cc744b8c45838895aa81f75d22f856ef99a9e.tar.bz2 build_soong-413cc744b8c45838895aa81f75d22f856ef99a9e.zip |
Recovery partition uses the first architecture only
To save space in the recovery partition, modules installed to the
partition are restricted to be built in the first architecure (i.e.,
32bit for 32bit-only device or when TARGET_PREFER_32_BIT is true, and
64bit otherwise).
Most notably, this change removes the 32-bit variant of the linker
(about 1MB). The linker was installed regardless of whether there is a
32-bit executable or not. Now, the unnecessary linker is not installed
and it is guaranteed that all modules in the partition are built with the
same architecture.
Bug: 79146551
Test: m -j
Test: out/target/product/<name>/recovery/root/system/bin/ has only one
variant of the linker.
Change-Id: I4070a43555bad4cfa8eff5253b09dcd004ea8251
Diffstat (limited to 'cc/cc.go')
-rw-r--r-- | cc/cc.go | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -1569,6 +1569,19 @@ func imageMutator(mctx android.BottomUpMutatorContext) { recoveryVariantNeeded = true } + if recoveryVariantNeeded { + var recoveryMultilib string + if mctx.Config().DevicePrefer32BitExecutables() { + recoveryMultilib = "lib32" + } else { + recoveryMultilib = "lib64" + } + multilib := genrule.Target().Arch.ArchType.Multilib + if multilib != recoveryMultilib { + recoveryVariantNeeded = false + } + } + var variants []string if coreVariantNeeded { variants = append(variants, coreMode) @@ -1676,6 +1689,19 @@ func imageMutator(mctx android.BottomUpMutatorContext) { coreVariantNeeded = false } + if recoveryVariantNeeded { + var recoveryMultilib string + if mctx.Config().DevicePrefer32BitExecutables() { + recoveryMultilib = "lib32" + } else { + recoveryMultilib = "lib64" + } + multilib := m.Target().Arch.ArchType.Multilib + if multilib != recoveryMultilib { + recoveryVariantNeeded = false + } + } + var variants []string if coreVariantNeeded { variants = append(variants, coreMode) |