Initial stab at NDK r11 support
authorFredrik Fornwall <fredrik@fornwall.net>
Thu, 10 Mar 2016 11:01:58 +0000 (12:01 +0100)
committerFredrik Fornwall <fredrik@fornwall.net>
Thu, 10 Mar 2016 11:01:58 +0000 (12:01 +0100)
README.md
build-package.sh
ndk_patches/sys-user.h.patch
packages/busybox/include-platform.h.patch [new file with mode: 0644]
packages/busybox/include-platform.h.patch64 [deleted file]

index 70ef929..a750b17 100644 (file)
--- a/README.md
+++ b/README.md
@@ -23,7 +23,7 @@ setup steps:
 * Install the Android SDK at `$HOME/lib/android-sdk`. Override this by setting the environment
 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.
 
 Alternatively a Dockerfile is provided which sets up a pristine image
index 8c8e5fc..a8ce863 100755 (executable)
@@ -59,7 +59,13 @@ export TERMUX_TOUCH="touch"
 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):
-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 ACLOCAL="aclocal -I $TERMUX_PREFIX/share/aclocal"
@@ -127,7 +133,7 @@ if [ ! -d $TERMUX_STANDALONE_TOOLCHAIN ]; then
                _TERMUX_NDK_TOOLCHAIN_NAME="$TERMUX_HOST_PLATFORM"
        fi
        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
                 # 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
index fa4861b..73f2578 100644 (file)
@@ -15,23 +15,3 @@ diff -u -r /home/fornwall/lib/android-ndk/platforms/android-21/arch-arm64/usr/in
  #elif defined(__x86_64__)
  
  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
diff --git a/packages/busybox/include-platform.h.patch b/packages/busybox/include-platform.h.patch
new file mode 100644 (file)
index 0000000..cd525a3
--- /dev/null
@@ -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
diff --git a/packages/busybox/include-platform.h.patch64 b/packages/busybox/include-platform.h.patch64
deleted file mode 100644 (file)
index fa5b6e1..0000000
+++ /dev/null
@@ -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