Pair mips64r6 with mips32r2 on Aosp

On mips64r6 cpus, the preferred zero-emulation-overhead 32-bit arch
variant is mips32r6.  Mips32r1 and mips32r2 software runs but with
frequent op-emulation traps to the kernel.  Android NDK had support
for mips32r6 prebuilt binaries in release r10 but lacked STL binaries
in r11 and omits all mips32r6 prebuilts in r13.

To keep mips64 buildable using just aosp sources, switch to using the
slower mips32r2 variant as its 2nd cpu arch.  This applies only to the
aosp copy of Android.  Imgtec's redistribution of Android releases will
instead use mips32r6 as the 2nd cpu arch, using a privately-maintained
prebuilts/ndk that includes all needed mips32r6 libraries.

The standard 32-bit Mips build on aosp uses mips32r2 as its native ABI.
That also runs mips32r1 apps built by NDK and mips32r1 android STL
components built by NDK.  Similarly, the 2nd arch for mips64r6 will
use mips32r2 itself but runs fine with mips32r1 apps and components.

Change-Id: I65c3fa9a3e5427be12955b902e6ec965de85e608
This commit is contained in:
Duane Sand 2016-07-19 15:07:43 -07:00 committed by Duane Sand
parent 47b57e6bd2
commit 9f525961ac
1 changed files with 4 additions and 1 deletions

View File

@ -31,7 +31,10 @@ TARGET_CPU_ABI := mips64
TARGET_2ND_ARCH := mips
ifeq (,$(TARGET_2ND_ARCH_VARIANT))
ifeq ($(TARGET_ARCH_VARIANT),mips64r6)
TARGET_2ND_ARCH_VARIANT := mips32r6
# Imgtec builds use 32r6 arch variant with Imgtec-maintained prebuilts/ndk library:
# TARGET_2ND_ARCH_VARIANT := mips32r6
# Aosp builds lack full set of mips32r6 NDK prebuilts, so use 32r2 abi:
TARGET_2ND_ARCH_VARIANT := mips32r2-fp
else
TARGET_2ND_ARCH_VARIANT := mips32r2-fp
endif