Initial stab at NDK r11 support
This commit is contained in:
parent
ec40c73f60
commit
c30d38226b
@ -23,7 +23,7 @@ setup steps:
|
|||||||
* Install the Android SDK at `$HOME/lib/android-sdk`. Override this by setting the environment
|
* Install the Android SDK at `$HOME/lib/android-sdk`. Override this by setting the environment
|
||||||
variable `$ANDROID_HOME` to point at another location.
|
variable `$ANDROID_HOME` to point at another location.
|
||||||
|
|
||||||
* Install the Android NDK, version r10e, at `$HOME/lib/android-ndk`. Override this by setting
|
* Install the Android NDK, version r11, at `$HOME/lib/android-ndk`. Override this by setting
|
||||||
the environment variable `$NDK` to point at another location.
|
the environment variable `$NDK` to point at another location.
|
||||||
|
|
||||||
Alternatively a Dockerfile is provided which sets up a pristine image
|
Alternatively a Dockerfile is provided which sets up a pristine image
|
||||||
|
@ -59,7 +59,13 @@ export TERMUX_TOUCH="touch"
|
|||||||
test `uname` = "Darwin" && TERMUX_TOUCH=gtouch
|
test `uname` = "Darwin" && TERMUX_TOUCH=gtouch
|
||||||
|
|
||||||
# Compute NDK version. We remove the first character (the r in e.g. r9d) to get a version number which can be used in packages):
|
# Compute NDK version. We remove the first character (the r in e.g. r9d) to get a version number which can be used in packages):
|
||||||
export TERMUX_NDK_VERSION=`cut -d ' ' -f 1 $NDK/RELEASE.TXT | cut -c 2-`
|
export TERMUX_NDK_VERSION=11
|
||||||
|
if grep -s -q "Pkg.Revision = $TERMUX_NDK_VERSION" $NDK/source.properties; then
|
||||||
|
:
|
||||||
|
else
|
||||||
|
echo "Wrong NDK version - we need $TERMUX_NDK_VERSION"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
export prefix=${TERMUX_PREFIX} # prefix is used by some makefiles
|
export prefix=${TERMUX_PREFIX} # prefix is used by some makefiles
|
||||||
#export ACLOCAL="aclocal -I $TERMUX_PREFIX/share/aclocal"
|
#export ACLOCAL="aclocal -I $TERMUX_PREFIX/share/aclocal"
|
||||||
@ -127,7 +133,7 @@ if [ ! -d $TERMUX_STANDALONE_TOOLCHAIN ]; then
|
|||||||
_TERMUX_NDK_TOOLCHAIN_NAME="$TERMUX_HOST_PLATFORM"
|
_TERMUX_NDK_TOOLCHAIN_NAME="$TERMUX_HOST_PLATFORM"
|
||||||
fi
|
fi
|
||||||
bash $NDK/build/tools/make-standalone-toolchain.sh --platform=android-$TERMUX_API_LEVEL --toolchain=${_TERMUX_NDK_TOOLCHAIN_NAME}-${TERMUX_GCC_VERSION} \
|
bash $NDK/build/tools/make-standalone-toolchain.sh --platform=android-$TERMUX_API_LEVEL --toolchain=${_TERMUX_NDK_TOOLCHAIN_NAME}-${TERMUX_GCC_VERSION} \
|
||||||
--install-dir=$TERMUX_STANDALONE_TOOLCHAIN --system=`uname | tr '[:upper:]' '[:lower:]'`-x86_64
|
--install-dir=$TERMUX_STANDALONE_TOOLCHAIN
|
||||||
if [ "arm" = $TERMUX_ARCH ]; then
|
if [ "arm" = $TERMUX_ARCH ]; then
|
||||||
# Fix to allow e.g. <bits/c++config.h> to be included:
|
# Fix to allow e.g. <bits/c++config.h> to be included:
|
||||||
cp $TERMUX_STANDALONE_TOOLCHAIN/include/c++/$TERMUX_GCC_VERSION/arm-linux-androideabi/armv7-a/bits/* $TERMUX_STANDALONE_TOOLCHAIN/include/c++/$TERMUX_GCC_VERSION/bits
|
cp $TERMUX_STANDALONE_TOOLCHAIN/include/c++/$TERMUX_GCC_VERSION/arm-linux-androideabi/armv7-a/bits/* $TERMUX_STANDALONE_TOOLCHAIN/include/c++/$TERMUX_GCC_VERSION/bits
|
||||||
|
@ -15,23 +15,3 @@ diff -u -r /home/fornwall/lib/android-ndk/platforms/android-21/arch-arm64/usr/in
|
|||||||
#elif defined(__x86_64__)
|
#elif defined(__x86_64__)
|
||||||
|
|
||||||
struct user_fpregs_struct {
|
struct user_fpregs_struct {
|
||||||
@@ -234,7 +240,18 @@
|
|
||||||
|
|
||||||
#elif defined(__aarch64__)
|
|
||||||
|
|
||||||
-// There are no user structures for 64 bit arm.
|
|
||||||
+/* From https://codereview.chromium.org/1291983003 */
|
|
||||||
+struct user_regs_struct {
|
|
||||||
+ __u64 regs[31];
|
|
||||||
+ __u64 sp;
|
|
||||||
+ __u64 pc;
|
|
||||||
+ __u64 pstate;
|
|
||||||
+};
|
|
||||||
+struct user_fpsimd_struct {
|
|
||||||
+ __uint128_t vregs[32];
|
|
||||||
+ __u32 fpsr;
|
|
||||||
+ __u32 fpcr;
|
|
||||||
+};
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
|
18
packages/busybox/include-platform.h.patch
Normal file
18
packages/busybox/include-platform.h.patch
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
The r11 of NDK removed dprintf.
|
||||||
|
|
||||||
|
diff -u -r ../busybox-1.24.1/include/platform.h ./include/platform.h
|
||||||
|
--- ../busybox-1.24.1/include/platform.h 2015-07-13 04:18:47.000000000 +0200
|
||||||
|
+++ ./include/platform.h 2016-03-10 11:47:06.000000000 +0100
|
||||||
|
@@ -480,11 +480,7 @@
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(ANDROID) || defined(__ANDROID__)
|
||||||
|
-# if __ANDROID_API__ < 8
|
||||||
|
-# undef HAVE_DPRINTF
|
||||||
|
-# else
|
||||||
|
-# define dprintf fdprintf
|
||||||
|
-# endif
|
||||||
|
+# undef HAVE_DPRINTF
|
||||||
|
# if __ANDROID_API__ < 21
|
||||||
|
# undef HAVE_TTYNAME_R
|
||||||
|
# undef HAVE_GETLINE
|
@ -1,14 +0,0 @@
|
|||||||
fdprintf() does not exist in 64-bit bionic.
|
|
||||||
|
|
||||||
diff -u -r ../busybox-1.24.1/include/platform.h ./include/platform.h
|
|
||||||
--- ../busybox-1.24.1/include/platform.h 2015-07-12 22:18:47.000000000 -0400
|
|
||||||
+++ ./include/platform.h 2015-11-26 16:14:37.061610995 -0500
|
|
||||||
@@ -480,7 +480,7 @@
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(ANDROID) || defined(__ANDROID__)
|
|
||||||
-# if __ANDROID_API__ < 8
|
|
||||||
+# if __ANDROID_API__ < 8 || defined(__LP64__)
|
|
||||||
# undef HAVE_DPRINTF
|
|
||||||
# else
|
|
||||||
# define dprintf fdprintf
|
|
Loading…
Reference in New Issue
Block a user