Initial support for android-mips64 target

This commit is contained in:
pancake 2014-11-11 01:26:05 +01:00
parent 68cbdcfe06
commit 0dd75de2cb
5 changed files with 42 additions and 9 deletions

View File

@ -13,8 +13,8 @@ endif
ifeq (${NDK_ARCH},mips)
# mips
ARCH2=mipsel
RANLIB=${ARCH2}-linux-android-ranlib
CC_AR=${ARCH2}-linux-android-ar -r ${LIBAR}
RANLIB=${ARCH2}-linux-androideabi-ranlib
CC_AR=${ARCH2}-linux-androideabi-ar -r ${LIBAR}
endif
ifeq (${NDK_ARCH},arm)

View File

@ -3,7 +3,7 @@
BUILD=1
PREFIX="/data/data/org.radare.installer/radare2"
if [ -z "${NDK}" ]; then
echo "use ./android-{arm|aarch64|mips|x86}.sh"
echo "use ./android-{arm|aarch64|mips|mips64|x86}.sh"
exit 1
fi
@ -15,6 +15,11 @@ case "$1" in
STATIC_BUILD=0
STRIP=mips-linux-android-strip
;;
"mips64")
NDK_ARCH=mips64
STATIC_BUILD=0
STRIP=mips64el-linux-android-strip
;;
"arm")
NDK_ARCH=arm
STATIC_BUILD=0
@ -48,8 +53,14 @@ mips-static|static-mips)
STATIC_BUILD=1
STRIP=mips-linux-android-strip
;;
mips64-static|static-mips)
NDK_ARCH=mips64
# XXX: by default we should build all libs as .a but link binary dinamically
STATIC_BUILD=1
STRIP=mips64el-linux-android-strip
;;
""|"-h")
echo "Usage: android-build.sh [arm|aarch64|x86|mips][-static]"
echo "Usage: android-build.sh [arm|aarch64|x86|mips|mips64][-static]"
exit 1
;;
*)

4
sys/android-mips64.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
cd `dirname $PWD/$0`
export CFLAGS="-O3 -fPIC -pie -fpic"
./android-shell.sh mips64 ./android-build.sh mips64-static

View File

@ -6,7 +6,15 @@ if [ -n "$1" ]; then
shift
fi
case "${NDK_ARCH}" in
mips|x86)
mips64)
AR=mips64el-linux-android-ar
RANLIB=mips64el-linux-android-ranlib
;;
mips)
AR=mipsel-linux-android-ar
RANLIB=mipsel-linux-android-ranlib
;;
x86)
export NDK_ARCH
;;
aarch64)
@ -20,7 +28,7 @@ arm)
RANLIB=arm-linux-androideabi-ranlib
;;
*)
echo "Usage: $0 [aarch64|arm|mips|x86]"
echo "Usage: $0 [aarch64|arm|mips|mips64|x86]"
exit 1
;;
esac
@ -54,12 +62,14 @@ if [ ! -d "${NDK}" ]; then
exit 1
fi
TOOLCHAIN_MIPS=`ls ${NDK}/toolchains/ |grep "^mips" |sort |head -n 1`
TOOLCHAIN_MIPS=`ls ${NDK}/toolchains/ |grep "^mips" | grep -v mips64|sort |head -n 1`
TOOLCHAIN_MIPS64=`ls ${NDK}/toolchains/ |grep "mips64" |sort |head -n 1`
TOOLCHAIN_ARM=`ls ${NDK}/toolchains/ |grep "^arm" |sort |head -n 1`
TOOLCHAIN_AARCH64=`ls ${NDK}/toolchains/ |grep "^aarch64" |sort |head -n 1`
TOOLCHAIN_X86=`ls ${NDK}/toolchains/ |grep "^x86" |sort |head -n 1`
NDKPATH_MIPS=`echo ${NDK}/toolchains/${TOOLCHAIN_MIPS}/prebuilt/${OS}-x86*/bin/`
NDKPATH_MIPS64=`echo ${NDK}/toolchains/${TOOLCHAIN_MIPS64}/prebuilt/${OS}-x86*/bin/`
NDKPATH_ARM=`echo ${NDK}/toolchains/${TOOLCHAIN_ARM}/prebuilt/${OS}-x86*/bin/`
NDKPATH_AARCH64=`echo ${NDK}/toolchains/${TOOLCHAIN_AARCH64}/prebuilt/${OS}-x86*/bin/`
NDKPATH_X86=`echo ${NDK}/toolchains/${TOOLCHAIN_X86}/prebuilt/${OS}-x86*/bin/`
@ -70,7 +80,7 @@ NDKPATH_X86=`echo ${NDK}/toolchains/${TOOLCHAIN_X86}/prebuilt/${OS}-x86*/bin/`
#CFLAGS=-I${INCDIR}
#echo $NDKPATH_ARM
PATH=$SDK/tools:$SDK/platform-tools:$NDK:${NDKPATH_X86}:${NDKPATH_ARM}:${NDKPATH_MIPS}:${NDKPATH_AARCH64}:$PATH
PATH=$SDK/tools:$SDK/platform-tools:$NDK:${NDKPATH_X86}:${NDKPATH_ARM}:${NDKPATH_MIPS}:${NDKPATH_AARCH64}:${NDKPATH_MIPS64}:$PATH
export PATH
export CFLAGS
export NDK

View File

@ -29,12 +29,20 @@ arm)
;;
mips)
ANDROID_SDK_VERSION=9 #mips
NDKPFX=mips-linux-android
NDKPFX=mipsel-linux-android
${NDKPFX}-gcc 2>/dev/null
if [ $? -gt 1 ]; then
NDKPFX=mipsel-linux-android
fi
;;
mips64)
ANDROID_SDK_VERSION=21 #mips64
NDKPFX=mips64el-linux-android
${NDKPFX}-gcc 2>/dev/null
if [ $? -gt 1 ]; then
NDKPFX=mips64el-linux-android
fi
;;
x86)
ANDROID_SDK_VERSION=9 #x86
NDKPFX=i686-android-linux