From d37ea94f2a85d0d23acaae2014a19d46693fe3df Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Tue, 14 Apr 2020 16:55:06 -0400 Subject: Android: Compile native android bits with armv7-a CPU flags DX50/DX90 has a Cortex-A9 with NEON, use those specific flags for speed. Generic Android targets is for v4.4 (API 19) which doesn't support pre-v7 ARM CPUs, so target generic armv7-a with hardfp support. (This patch includes a rearrangement of the android toolchain helpers to allow target-specific GCCOPTS. Huzzah) Change-Id: I696051ef3fae25e1569c7b904decb7a3a0c6b674 --- tools/configure | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'tools/configure') diff --git a/tools/configure b/tools/configure index a41a9e529b..38130f85e8 100755 --- a/tools/configure +++ b/tools/configure @@ -776,6 +776,7 @@ androidcc () { thread_support="HAVE_SIGALTSTACK_THREADS" ANDROID_ARCH=$2 # for android.make too ANDROID_PLATFORM_VERSION=$1 + GCCOPTS="$GCCOPTS $3" gccchoice="4.9" # arch dependant stuff case $ANDROID_ARCH in @@ -787,7 +788,18 @@ androidcc () { if [ ${?} != 0 ]; then exit fi - GCCOPTS="$GCCOPTS -march=armv5te -mtune=xscale -msoft-float -fomit-frame-pointer -fuse-ld=bfd" + # Android 4.4 (API 19) doesn't support anything older than armv7. + GCCOPTS="$GCCOPTS -fomit-frame-pointer -fuse-ld=bfd" + ;; + aarch64) + endian="little" + gcctarget="arm-linux-androideabi-" + echo "${make_toolchain} --toolchain=aarch64-linux-android-${gccchoice} --platform=android-$ANDROID_PLATFORM_VERSION --install-dir=${pwd}/android-toolchain" + ${make_toolchain} --toolchain=aarch64-linux-android-${gccchoice} --platform=android-$ANDROID_PLATFORM_VERSION --install-dir=${pwd}/android-toolchain + if [ ${?} != 0 ]; then + exit + fi + GCCOPTS="$GCCOPTS -fomit-frame-pointer -fuse-ld=bfd" # what default cpu arch/tune to use? ;; mips) endian="little" @@ -849,6 +861,7 @@ androidndkcc() GLOBAL_LDOPTS="-Wl,-z,defs -Wl,-z,noexecstack" ANDROID_PLATFORM_VERSION=$1 + GCCOPTS="$GCCOPTS $3" # arch dependant stuff case $2 in @@ -861,7 +874,7 @@ androidndkcc() if [ ${?} != 0 ]; then exit fi - GCCOPTS="$GCCOPTS -march=armv5te -mtune=xscale -msoft-float -fomit-frame-pointer" + GCCOPTS="$GCCOPTS -fomit-frame-pointer" ;; *) echo "ERROR: androidndkcc(): Unknown target architecture" @@ -3570,7 +3583,7 @@ fi libdir="/data/data/org.rockbox/app_rockbox" memory=8 uname=`uname` - androidcc 19 armeabi + androidcc 19 armeabi "-march=armv7-a -mtune=cortex-a9 -mfloat-abi=softfp" tool="cp " boottool="cp " bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" @@ -4165,7 +4178,7 @@ fi # Actually 408260kB memory=256 uname=`uname` - androidndkcc 16 armeabi + androidndkcc 16 armeabi "-mcpu=cortex-a9 -mfpu=neon-fp16 -mfloat-abi=softfp" tool="cp " boottool="cp " bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" @@ -4190,7 +4203,7 @@ fi lcd_orientation="landscape" memory=256 uname=`uname` - androidndkcc 16 armeabi + androidndkcc 16 armeabi "-mcpu=cortex-a9 -mfpu=neon-fp16 -mfloat-abi=softfp" tool="cp " boottool="cp " bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" -- cgit v1.2.3