From c30d38226bca5f9a23bc2eeaa4ddb3050a69718c Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Thu, 10 Mar 2016 12:01:58 +0100 Subject: [PATCH 01/13] Initial stab at NDK r11 support --- README.md | 2 +- build-package.sh | 10 ++++++++-- ndk_patches/sys-user.h.patch | 20 -------------------- packages/busybox/include-platform.h.patch | 18 ++++++++++++++++++ packages/busybox/include-platform.h.patch64 | 14 -------------- 5 files changed, 27 insertions(+), 37 deletions(-) create mode 100644 packages/busybox/include-platform.h.patch delete mode 100644 packages/busybox/include-platform.h.patch64 diff --git a/README.md b/README.md index 70ef92972..a750b1731 100644 --- 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 diff --git a/build-package.sh b/build-package.sh index 8c8e5fc98..a8ce863e7 100755 --- a/build-package.sh +++ b/build-package.sh @@ -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. 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 diff --git a/ndk_patches/sys-user.h.patch b/ndk_patches/sys-user.h.patch index fa4861ba6..73f2578af 100644 --- a/ndk_patches/sys-user.h.patch +++ b/ndk_patches/sys-user.h.patch @@ -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 index 000000000..cd525a308 --- /dev/null +++ b/packages/busybox/include-platform.h.patch @@ -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 index fa5b6e1b3..000000000 --- a/packages/busybox/include-platform.h.patch64 +++ /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 From dee0c12bfbe12b155c40959570547f86397fdbcc Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Thu, 10 Mar 2016 06:31:43 -0500 Subject: [PATCH 02/13] Download NDK r11 in Dockerfile (untested) --- Dockerfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6f134c139..1ad151cb5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -50,12 +50,11 @@ RUN apt-get update && apt-get install -y \ RUN cd /tmp && \ curl -O http://dl.google.com/android/android-sdk_r24.3.4-linux.tgz && \ - curl -O http://dl.google.com/android/ndk/android-ndk-r10e-linux-x86_64.bin && \ - tar xzvf /tmp/android-sdk_r24.3.4-linux.tgz && \ - chmod 755 /tmp/android-ndk* && /tmp/android-ndk-r10e-linux-x86_64.bin && \ + curl -o ndk.zip http://dl.google.com/android/repository/android-ndk-r11-linux-x86_64.zip && \ + unzip ndk.zip && \ mkdir /root/lib && \ mv /tmp/android-sdk-linux /root/lib/android-sdk && \ - mv /tmp/android-ndk-r10e /root/lib/android-ndk && \ + mv /tmp/android-ndk-r11-linux-x86_64.tar.bz2 /root/lib/android-ndk && \ rm -fr /tmp/* RUN mkdir -p /data/data/com.termux/files/usr && mkdir -p /root/termux-packages && \ From 2b90cc3d1676ef813db78c2bb17dabe6d796b787 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Thu, 10 Mar 2016 07:17:59 -0500 Subject: [PATCH 03/13] libgc: NDK r11 compatibility (tkill removed) --- packages/libgc/pthread_stop_world.c.patch | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 packages/libgc/pthread_stop_world.c.patch diff --git a/packages/libgc/pthread_stop_world.c.patch b/packages/libgc/pthread_stop_world.c.patch new file mode 100644 index 000000000..28f66bc07 --- /dev/null +++ b/packages/libgc/pthread_stop_world.c.patch @@ -0,0 +1,14 @@ +The tkill(2) function was removed from libc in NDK r11. + +diff -u -r ../bdwgc-c861ec3d1825b5bb450d20bf9091562fa8a81a4d/pthread_stop_world.c ./pthread_stop_world.c +--- ../bdwgc-c861ec3d1825b5bb450d20bf9091562fa8a81a4d/pthread_stop_world.c 2016-01-13 03:34:56.000000000 -0500 ++++ ./pthread_stop_world.c 2016-03-10 07:09:03.607785056 -0500 +@@ -450,7 +450,7 @@ + #endif + + #ifdef USE_TKILL_ON_ANDROID +- extern int tkill(pid_t tid, int sig); /* from sys/linux-unistd.h */ ++ static int tkill(pid_t tid, int sig) { return tgkill(-1, tid, sig); } + + static int android_thread_kill(pid_t tid, int sig) + { From 10b7af443de69d44ef89f3db15c2a2ef1f1ba853 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Thu, 10 Mar 2016 10:04:11 -0500 Subject: [PATCH 04/13] clang: Remove workaround not needed in NDK r11 --- packages/clang/build.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/clang/build.sh b/packages/clang/build.sh index 91038e5cd..c893ff368 100644 --- a/packages/clang/build.sh +++ b/packages/clang/build.sh @@ -32,8 +32,6 @@ termux_step_host_build () { } termux_step_configure () { - CXXFLAGS+=" -fno-devirtualize" # Avoid hitting https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61659 - cd $TERMUX_PKG_BUILDDIR LLVM_DEFAULT_TARGET_TRIPLE=$TERMUX_HOST_PLATFORM LLVM_TARGET_ARCH=$TERMUX_ARCH From 47e003b1b65c65d7a11d3fcabc0925426765f633 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Thu, 10 Mar 2016 10:52:00 -0500 Subject: [PATCH 05/13] dnsutils: Update patch level --- packages/dnsutils/build.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/dnsutils/build.sh b/packages/dnsutils/build.sh index 5b52b5b61..466dfd5ed 100644 --- a/packages/dnsutils/build.sh +++ b/packages/dnsutils/build.sh @@ -2,10 +2,10 @@ TERMUX_PKG_HOMEPAGE=https://www.isc.org/downloads/bind/ TERMUX_PKG_DESCRIPTION="Clients provided with BIND" # NOTE: When changing this version, you also needo to change TERMUX_PKG_SRCURL # and TERMUX_PKG_FOLDERNAME. -TERMUX_PKG_VERSION=9.10.3.3 -# TERMUX_PKG_SRCURL="https://www.isc.org/downloads/file/bind-9-10-3-p2/?version=tar-gz" -TERMUX_PKG_SRCURL="https://ftp.isc.org/isc/bind/cur/9.10/bind-9.10.3-P3.tar.gz" -TERMUX_PKG_FOLDERNAME="bind-9.10.3-P3" +_PATCHLEVEL=4 +TERMUX_PKG_VERSION=9.10.3.$_PATCHLEVEL +TERMUX_PKG_SRCURL="https://ftp.isc.org/isc/bind/cur/9.10/bind-9.10.3-P${_PATCHLEVEL}.tar.gz" +TERMUX_PKG_FOLDERNAME="bind-9.10.3-P${_PATCHLEVEL}" TERMUX_PKG_DEPENDS="openssl, readline, resolv-conf" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --with-gssapi=no --with-randomdev=/dev/random -with-ecdsa=no --with-gost=no --with-libxml2=no --with-libtool" From fc3ae02b63b322c9dd7fe85d7fa70a90814958dd Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Thu, 10 Mar 2016 11:47:23 -0500 Subject: [PATCH 06/13] gdb: Update 7.10 to 7.11 and NDK r11 compatibility --- packages/gdb/build.sh | 6 ++- packages/gdb/gdb-arm-linux-nac.c.patch | 8 ---- packages/gdb/gdb-gdbserver-configure.patch | 21 +++++++++++ .../gdb/gdbserver_gdb_proc_service.h.patch | 12 ------ packages/gdb/i386-linux-nat.c.patch | 15 -------- packages/gdb/linux-arm-low.c.patch | 11 ------ packages/gdb/linux-x86-low.c.patch | 23 ------------ packages/gdb/linux_low.patch | 37 ------------------- packages/gdb/linux_nat.patch | 17 --------- packages/gdb/nm-linux.h.patch | 24 ------------ packages/gdb/proc_server_c_procfs.patch | 11 ------ packages/gdb/x86-linux-nat.c.patch | 23 ------------ 12 files changed, 25 insertions(+), 183 deletions(-) create mode 100644 packages/gdb/gdb-gdbserver-configure.patch delete mode 100644 packages/gdb/gdbserver_gdb_proc_service.h.patch delete mode 100644 packages/gdb/i386-linux-nat.c.patch delete mode 100644 packages/gdb/linux-arm-low.c.patch delete mode 100644 packages/gdb/linux-x86-low.c.patch delete mode 100644 packages/gdb/linux_low.patch delete mode 100644 packages/gdb/nm-linux.h.patch delete mode 100644 packages/gdb/proc_server_c_procfs.patch delete mode 100644 packages/gdb/x86-linux-nat.c.patch diff --git a/packages/gdb/build.sh b/packages/gdb/build.sh index 2ec4db60c..6ca430f6e 100755 --- a/packages/gdb/build.sh +++ b/packages/gdb/build.sh @@ -1,8 +1,7 @@ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/gdb/ TERMUX_PKG_DESCRIPTION="The standard GNU Debugger that runs on many Unix-like systems and works for many programming languages" TERMUX_PKG_DEPENDS="liblzma, libexpat, readline" -TERMUX_PKG_VERSION=7.10.1 -TERMUX_PKG_BUILD_REVISION=2 +TERMUX_PKG_VERSION=7.11 TERMUX_PKG_SRCURL=http://ftp.gnu.org/gnu/gdb/gdb-${TERMUX_PKG_VERSION}.tar.xz # gdb can not build with our normal --disable-static: https://sourceware.org/bugzilla/show_bug.cgi?id=15916 TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-system-readline --with-curses --enable-static ac_cv_func_getpwent=no ac_cv_func_getpwnam=no" @@ -13,3 +12,6 @@ TERMUX_PKG_BUILD_IN_SRC="yes" # For frexp(3) usage: LDFLAGS+=" -lm" + +export gl_cv_func_gettimeofday_clobber=no +export gl_cv_func_gettimeofday_posix_signature=yes diff --git a/packages/gdb/gdb-arm-linux-nac.c.patch b/packages/gdb/gdb-arm-linux-nac.c.patch index 9fd6c5c4a..4f5838da2 100644 --- a/packages/gdb/gdb-arm-linux-nac.c.patch +++ b/packages/gdb/gdb-arm-linux-nac.c.patch @@ -1,14 +1,6 @@ diff -u -r ../gdb-7.10/gdb/arm-linux-nat.c ./gdb/arm-linux-nat.c --- ../gdb-7.10/gdb/arm-linux-nat.c 2015-08-28 17:22:07.000000000 -0400 +++ ./gdb/arm-linux-nat.c 2015-08-29 08:06:52.000680658 -0400 -@@ -34,7 +34,6 @@ - #include - #include - #include --#include - - #include "nat/linux-ptrace.h" - @@ -63,6 +62,10 @@ #define PTRACE_SETHBPREGS 30 #endif diff --git a/packages/gdb/gdb-gdbserver-configure.patch b/packages/gdb/gdb-gdbserver-configure.patch new file mode 100644 index 000000000..3ede86d36 --- /dev/null +++ b/packages/gdb/gdb-gdbserver-configure.patch @@ -0,0 +1,21 @@ +diff -u -r ../gdb-7.11/gdb/gdbserver/configure ./gdb/gdbserver/configure +--- ../gdb-7.11/gdb/gdbserver/configure 2016-02-09 22:19:39.000000000 -0500 ++++ ./gdb/gdbserver/configure 2016-03-10 10:17:40.111988028 -0500 +@@ -6735,17 +6735,6 @@ + + + case "${target}" in +- *-android*) +- # Starting with NDK version 9, actually includes definitions +- # of Elf32_auxv_t and Elf64_auxv_t. But sadly, includes +- # which defines some of the ELF types incorrectly, +- # leading to conflicts with the defintions from . +- # This makes it impossible for us to include both and +- # , which means that, in practice, we do not have +- # access to Elf32_auxv_t and Elf64_auxv_t on this platform. +- # Therefore, do not try to auto-detect availability, as it would +- # get it wrong on this platform. +- ;; + *) + ac_fn_c_check_type "$LINENO" "Elf32_auxv_t" "ac_cv_type_Elf32_auxv_t" "#include + diff --git a/packages/gdb/gdbserver_gdb_proc_service.h.patch b/packages/gdb/gdbserver_gdb_proc_service.h.patch deleted file mode 100644 index 2b71d3166..000000000 --- a/packages/gdb/gdbserver_gdb_proc_service.h.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -u -r ../gdb-7.8.1/gdb/gdbserver/gdb_proc_service.h ./gdb/gdbserver/gdb_proc_service.h ---- ../gdb-7.8.1/gdb/gdbserver/gdb_proc_service.h 2014-06-11 12:34:41.000000000 -0400 -+++ ./gdb/gdbserver/gdb_proc_service.h 2014-12-22 07:53:22.855702229 -0500 -@@ -38,6 +38,8 @@ - # endif - #endif - -+#include "../gregset.h" /* for elf_gregset_t */ -+ - typedef enum - { - PS_OK, /* Success. */ diff --git a/packages/gdb/i386-linux-nat.c.patch b/packages/gdb/i386-linux-nat.c.patch deleted file mode 100644 index cb67b2f38..000000000 --- a/packages/gdb/i386-linux-nat.c.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff -u -r ../gdb-7.9/gdb/i386-linux-nat.c ./gdb/i386-linux-nat.c ---- ../gdb-7.9/gdb/i386-linux-nat.c 2015-02-19 06:58:07.000000000 -0500 -+++ ./gdb/i386-linux-nat.c 2015-03-17 18:14:06.728805213 -0400 -@@ -35,6 +35,11 @@ - - #include "x86-linux-nat.h" - -+#ifdef __ANDROID__ -+#include -+typedef fpregset_t elf_fpxregset_t; -+#endif -+ - /* The register sets used in GNU/Linux ELF core-dumps are identical to - the register sets in `struct user' that is used for a.out - core-dumps, and is also used by `ptrace'. The corresponding types diff --git a/packages/gdb/linux-arm-low.c.patch b/packages/gdb/linux-arm-low.c.patch deleted file mode 100644 index aded24b8f..000000000 --- a/packages/gdb/linux-arm-low.c.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -u -r ../gdb-7.8.1/gdb/gdbserver/linux-arm-low.c ./gdb/gdbserver/linux-arm-low.c ---- ../gdb-7.8.1/gdb/gdbserver/linux-arm-low.c 2014-10-29 15:45:50.000000000 -0400 -+++ ./gdb/gdbserver/linux-arm-low.c 2014-12-22 07:57:06.035702383 -0500 -@@ -26,6 +26,7 @@ - #endif - #include - #include -+#include /* for AT_HWCAP define */ - - /* Defined in auto-generated files. */ - void init_registers_arm (void); diff --git a/packages/gdb/linux-x86-low.c.patch b/packages/gdb/linux-x86-low.c.patch deleted file mode 100644 index 34653b75e..000000000 --- a/packages/gdb/linux-x86-low.c.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff -u -r ../gdb-7.9/gdb/gdbserver/linux-x86-low.c ./gdb/gdbserver/linux-x86-low.c ---- ../gdb-7.9/gdb/gdbserver/linux-x86-low.c 2015-02-19 06:58:07.000000000 -0500 -+++ ./gdb/gdbserver/linux-x86-low.c 2015-03-17 18:29:50.412805866 -0400 -@@ -38,6 +38,11 @@ - #include "tracepoint.h" - #include "ax.h" - -+#ifdef __ANDROID__ -+#include -+typedef fpregset_t elf_fpxregset_t; -+#endif -+ - #ifdef __x86_64__ - /* Defined in auto-generated file amd64-linux.c. */ - void init_registers_amd64_linux (void); -@@ -113,7 +118,6 @@ - #endif - - #include --#include - #include - #include - diff --git a/packages/gdb/linux_low.patch b/packages/gdb/linux_low.patch deleted file mode 100644 index fb8d534e8..000000000 --- a/packages/gdb/linux_low.patch +++ /dev/null @@ -1,37 +0,0 @@ -diff -u -r ../gdb-7.8.1/gdb/gdbserver/linux-low.c ./gdb/gdbserver/linux-low.c ---- ../gdb-7.8.1/gdb/gdbserver/linux-low.c 2014-10-29 15:45:50.000000000 -0400 -+++ ./gdb/gdbserver/linux-low.c 2014-12-22 07:51:39.355702157 -0500 -@@ -47,6 +47,7 @@ - #include "filestuff.h" - #include "tracepoint.h" - #include "hostio.h" -+#include /* For AT_PHDR and AT_PHNUM defines */ - #ifndef ELFMAG0 - /* Don't include here. If it got included by gdb_proc_service.h - then ELFMAG0 will have been defined. If it didn't get included by -@@ -108,7 +109,6 @@ - # include "linux-btrace.h" - #endif - --#ifndef HAVE_ELF32_AUXV_T - /* Copied from glibc's elf.h. */ - typedef struct - { -@@ -121,9 +121,7 @@ - on 64-bit platforms and vice versa. */ - } a_un; - } Elf32_auxv_t; --#endif - --#ifndef HAVE_ELF64_AUXV_T - /* Copied from glibc's elf.h. */ - typedef struct - { -@@ -136,7 +134,6 @@ - on 64-bit platforms and vice versa. */ - } a_un; - } Elf64_auxv_t; --#endif - - /* A list of all unknown processes which receive stop signals. Some - other process will presumably claim each of these as forked diff --git a/packages/gdb/linux_nat.patch b/packages/gdb/linux_nat.patch index 30671c907..276eef9be 100644 --- a/packages/gdb/linux_nat.patch +++ b/packages/gdb/linux_nat.patch @@ -1,14 +1,6 @@ diff -u -r ../gdb-7.7/gdb/linux-nat.c ./gdb/linux-nat.c --- ../gdb-7.7/gdb/linux-nat.c 2014-02-06 03:21:29.000000000 +0100 +++ ./gdb/linux-nat.c 2014-02-12 01:55:15.000000000 +0100 -@@ -41,7 +41,6 @@ - #include "inf-child.h" - #include "inf-ptrace.h" - #include "auxv.h" --#include /* for elf_gregset etc. */ - #include "elf-bfd.h" /* for elfcore_write_* */ - #include "gregset.h" /* for gregset */ - #include "gdbcore.h" /* for get_exec_file */ @@ -68,6 +67,10 @@ #include "target-descriptions.h" #include "filestuff.h" @@ -20,12 +12,3 @@ diff -u -r ../gdb-7.7/gdb/linux-nat.c ./gdb/linux-nat.c #ifndef SPUFS_MAGIC #define SPUFS_MAGIC 0x23c9b64e #endif -@@ -3789,7 +3792,7 @@ - if (last.kind == TARGET_WAITKIND_FORKED - || last.kind == TARGET_WAITKIND_VFORKED) - { -- ptrace (PT_KILL, ptid_get_pid (last.value.related_pid), 0, 0); -+ ptrace (PTRACE_KILL, ptid_get_pid (last.value.related_pid), 0, 0); - wait (&status); - - /* Let the arch-specific native code know this process is diff --git a/packages/gdb/nm-linux.h.patch b/packages/gdb/nm-linux.h.patch deleted file mode 100644 index 0a551a783..000000000 --- a/packages/gdb/nm-linux.h.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -u -r ../gdb-7.8.1/gdb/config/nm-linux.h ./gdb/config/nm-linux.h ---- ../gdb-7.8.1/gdb/config/nm-linux.h 2014-06-11 12:34:41.000000000 -0400 -+++ ./gdb/config/nm-linux.h 2014-12-22 07:45:14.127701891 -0500 -@@ -20,5 +20,20 @@ - /* Use elf_gregset_t and elf_fpregset_t, rather than - gregset_t and fpregset_t. */ - -+#ifndef NM_CONFIG_LINUX_H -+#define NM_CONFIG_LINUX_H -+ -+#include -+ -+#ifdef __arm__ -+/* Structure to describe FPU registers. */ -+typedef struct fpregset { } fpregset_t; -+#endif -+ -+typedef gregset_t elf_gregset_t; -+typedef fpregset_t elf_fpregset_t; -+ - #define GDB_GREGSET_T elf_gregset_t - #define GDB_FPREGSET_T elf_fpregset_t -+ -+#endif diff --git a/packages/gdb/proc_server_c_procfs.patch b/packages/gdb/proc_server_c_procfs.patch deleted file mode 100644 index 530bd738a..000000000 --- a/packages/gdb/proc_server_c_procfs.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -u -r ../gdb-7.6.2/gdb/proc-service.c ./gdb/proc-service.c ---- ../gdb-7.6.2/gdb/proc-service.c 2013-12-08 05:33:13.000000000 +0100 -+++ ./gdb/proc-service.c 2014-01-07 16:43:01.866311352 +0100 -@@ -27,7 +27,6 @@ - - #include "gdb_proc_service.h" - --#include - - /* Prototypes for supply_gregset etc. */ - #include "gregset.h" diff --git a/packages/gdb/x86-linux-nat.c.patch b/packages/gdb/x86-linux-nat.c.patch deleted file mode 100644 index 3f455c2f4..000000000 --- a/packages/gdb/x86-linux-nat.c.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff -u -r ../gdb-7.9/gdb/x86-linux-nat.c ./gdb/x86-linux-nat.c ---- ../gdb-7.9/gdb/x86-linux-nat.c 2015-02-20 12:11:44.000000000 -0500 -+++ ./gdb/x86-linux-nat.c 2015-03-17 18:20:50.044805492 -0400 -@@ -23,7 +23,6 @@ - #include "gdb_proc_service.h" - #include - #include --#include - #include - - #include "x86-nat.h" -@@ -39,6 +38,11 @@ - #include "x86-xstate.h" - #include "nat/linux-btrace.h" - -+#ifdef __ANDROID__ -+#include -+typedef fpregset_t elf_fpxregset_t; -+#endif -+ - /* Per-thread arch-specific data we want to keep. */ - - struct arch_lwp_info From 736255bf734f524e428a9e0eb3e5815d65f034c4 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Thu, 10 Mar 2016 06:06:47 -0500 Subject: [PATCH 07/13] libgc: Update commit used --- packages/libgc/build.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/libgc/build.sh b/packages/libgc/build.sh index 9967cc4ce..18e67d49d 100644 --- a/packages/libgc/build.sh +++ b/packages/libgc/build.sh @@ -1,11 +1,11 @@ TERMUX_PKG_HOMEPAGE=http://www.hboehm.info/gc/ TERMUX_PKG_DESCRIPTION="Library providing the Boehm-Demers-Weiser conservative garbage collector" -# The latest release 7.4.2 is too old for aarch64, use the version -# https://github.com/ivmai/bdwgc/tree/c861ec3d1825b5bb450d20bf9091562fa8a81a4d -# from 2016-0-114 21:34 for now. -TERMUX_PKG_VERSION=7.4.201601142134 -TERMUX_PKG_SRCURL=https://github.com/ivmai/bdwgc/archive/c861ec3d1825b5bb450d20bf9091562fa8a81a4d.zip -TERMUX_PKG_FOLDERNAME=bdwgc-c861ec3d1825b5bb450d20bf9091562fa8a81a4d +# The latest release 7.4.2 is too old for aarch64, use commit on master for now. +# (update below commit and date in version when necessary): +_GC_COMMIT=9ddff68a20c064288da73a4316cabaef661948ab +TERMUX_PKG_VERSION=7.4.201603041111 +TERMUX_PKG_SRCURL=https://github.com/ivmai/bdwgc/archive/${_GC_COMMIT}.zip +TERMUX_PKG_FOLDERNAME=bdwgc-$_GC_COMMIT TERMUX_PKG_RM_AFTER_INSTALL="share/gc" # Avoid defining structs already defined in api level 21 or beyond From 0c6be16535cc3fb0a13cc1eb89897b6cecff33b4 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Thu, 10 Mar 2016 06:40:01 -0500 Subject: [PATCH 08/13] picolisp: Update from 16.2.11 to 16.3.1 --- packages/picolisp/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/picolisp/build.sh b/packages/picolisp/build.sh index d1a8d5d33..72b00c66e 100644 --- a/packages/picolisp/build.sh +++ b/packages/picolisp/build.sh @@ -1,13 +1,13 @@ TERMUX_PKG_HOMEPAGE=http://picolisp.com TERMUX_PKG_DESCRIPTION="Lisp interpreter and application server framework" -TERMUX_PKG_VERSION=16.2.11 +TERMUX_PKG_VERSION=16.3.1 TERMUX_PKG_SRCURL=http://software-lab.de/picoLisp.tgz TERMUX_PKG_FOLDERNAME=picoLisp TERMUX_PKG_BUILD_IN_SRC=true termux_step_pre_configure() { # Validate that we have the right version: - grep -q '16 2 11' src64/version.l + grep -q '16 3 1' src64/version.l TERMUX_PKG_SRCDIR=$TERMUX_PKG_SRCDIR/src if [ $TERMUX_ARCH_BITS = 64 ]; then From d6012486a5c3bf27fdb80081a4b986cafe457bc4 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Thu, 10 Mar 2016 15:18:21 -0500 Subject: [PATCH 09/13] Remove rpl_gettimeofday wrapping --- build-package.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build-package.sh b/build-package.sh index a8ce863e7..3e60e6bb5 100755 --- a/build-package.sh +++ b/build-package.sh @@ -362,6 +362,8 @@ termux_step_configure () { # . AVOID_AUTOCONF_WRAPPERS+=" gl_cv_func_getcwd_null=yes gl_cv_func_getcwd_posix_signature=yes gl_cv_func_getcwd_path_max=yes gl_cv_func_getcwd_abort_bug=no" AVOID_AUTOCONF_WRAPPERS+=" gl_cv_header_working_fcntl_h=yes gl_cv_func_fcntl_f_dupfd_cloexec=yes gl_cv_func_fcntl_f_dupfd_works=yes" + # Remove rpl_gettimeofday reference when building at least coreutils: + AVOID_AUTOCONF_WRAPPERS+=" gl_cv_func_tzset_clobber=no gl_cv_func_gettimeofday_clobber=no gl_cv_func_gettimeofday_posix_signature=yes" env $AVOID_AUTOCONF_WRAPPERS $TERMUX_PKG_SRCDIR/configure \ --disable-dependency-tracking \ From 03e92e97aa93120d1a56ef19a4ad3a5f9939861c Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Thu, 10 Mar 2016 15:18:35 -0500 Subject: [PATCH 10/13] gdb: Add comment explaining autoconf variables --- packages/gdb/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/gdb/build.sh b/packages/gdb/build.sh index 6ca430f6e..4d802d9cb 100755 --- a/packages/gdb/build.sh +++ b/packages/gdb/build.sh @@ -13,5 +13,6 @@ TERMUX_PKG_BUILD_IN_SRC="yes" # For frexp(3) usage: LDFLAGS+=" -lm" +# Fix "undefined reference to 'rpl_gettimeofday'" when building on x86: export gl_cv_func_gettimeofday_clobber=no export gl_cv_func_gettimeofday_posix_signature=yes From e8735a9e0a4a399cc25162ebd1321943571faa6f Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Thu, 10 Mar 2016 15:24:52 -0500 Subject: [PATCH 11/13] ndk_patches: Replace endpwent() with empty stub --- ndk_patches/pwd.patch | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ndk_patches/pwd.patch b/ndk_patches/pwd.patch index b302e8f8f..c35e60cc4 100644 --- a/ndk_patches/pwd.patch +++ b/ndk_patches/pwd.patch @@ -1,6 +1,6 @@ diff -u -r /home/fornwall/lib/android-ndk/platforms/android-21/arch-arm/usr/include/pwd.h ./usr/include/pwd.h ---- /home/fornwall/lib/android-ndk/platforms/android-21/arch-arm/usr/include/pwd.h 2014-10-14 22:53:49.000000000 -0400 -+++ ./usr/include/pwd.h 2015-07-15 09:42:32.974621965 -0400 +--- /home/fornwall/lib/android-ndk/platforms/android-21/arch-arm/usr/include/pwd.h 2016-03-03 16:54:24.000000000 -0500 ++++ ./usr/include/pwd.h 2016-03-10 08:11:16.795710172 -0500 @@ -65,6 +65,10 @@ #include #include @@ -12,10 +12,11 @@ diff -u -r /home/fornwall/lib/android-ndk/platforms/android-21/arch-arm/usr/incl #define _PATH_PASSWD "/etc/passwd" #define _PATH_MASTERPASSWD "/etc/master.passwd" #define _PATH_MASTERPASSWD_LOCK "/etc/ptmp" -@@ -119,6 +122,36 @@ +@@ -119,7 +123,37 @@ int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**); int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**); +-void endpwent(void); +static void android_setup_pwd(struct passwd* pw) { + static char realpath_buffer[4096/*PATH_MAX*/]; + char* result = realpath("@TERMUX_HOME@/.termux/shell", realpath_buffer); @@ -46,6 +47,6 @@ diff -u -r /home/fornwall/lib/android-ndk/platforms/android-21/arch-arm/usr/incl + +#define getpwnam android_polyfill_getpwnam +#define getpwuid android_polyfill_getpwuid - void endpwent(void); ++static void endpwent(void) { /* Do nothing. */ } struct passwd* getpwent(void); int setpwent(void); From f6ea6a84a3690609073ab4edad6a6a44af3d85ad Mon Sep 17 00:00:00 2001 From: Rik Snel Date: Thu, 10 Mar 2016 22:44:54 +0100 Subject: [PATCH 12/13] unpack android-sdk before moving unpacked data --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 1ad151cb5..9e42af81f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -50,6 +50,7 @@ RUN apt-get update && apt-get install -y \ RUN cd /tmp && \ curl -O http://dl.google.com/android/android-sdk_r24.3.4-linux.tgz && \ + tar xzvf /tmp/android-sdk_r24.3.4-linux.tgz && \ curl -o ndk.zip http://dl.google.com/android/repository/android-ndk-r11-linux-x86_64.zip && \ unzip ndk.zip && \ mkdir /root/lib && \ From 6e1eae49c02c6686ef4f49d665723d4a44530e9a Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Thu, 10 Mar 2016 18:19:59 -0500 Subject: [PATCH 13/13] clang: Update from 3.7.1 to 3.8.0 --- packages/clang/Makefile.patch | 11 +++++++++++ packages/clang/build.sh | 4 ++-- packages/clang/dont-build-c-index-test.patch | 14 +++++++------- 3 files changed, 20 insertions(+), 9 deletions(-) create mode 100644 packages/clang/Makefile.patch diff --git a/packages/clang/Makefile.patch b/packages/clang/Makefile.patch new file mode 100644 index 000000000..e497da96f --- /dev/null +++ b/packages/clang/Makefile.patch @@ -0,0 +1,11 @@ +diff -u -r ../llvm-3.8.0.src/Makefile ./Makefile +--- ../llvm-3.8.0.src/Makefile 2014-03-25 17:45:41.000000000 -0400 ++++ ./Makefile 2016-03-10 16:28:00.142389801 -0500 +@@ -69,7 +69,6 @@ + ifeq ($(MAKECMDGOALS),install-clang) + DIRS := tools/clang/tools/driver tools/clang/lib/Headers \ + tools/clang/tools/libclang \ +- tools/clang/tools/c-index-test \ + tools/clang/include/clang-c \ + tools/clang/runtime tools/clang/docs \ + tools/lto diff --git a/packages/clang/build.sh b/packages/clang/build.sh index c893ff368..b649d9425 100644 --- a/packages/clang/build.sh +++ b/packages/clang/build.sh @@ -1,7 +1,7 @@ TERMUX_PKG_HOMEPAGE=http://clang.llvm.org/ TERMUX_PKG_DESCRIPTION="C and C++ frontend for the LLVM compiler" -_PKG_MAJOR_VERSION=3.7 -TERMUX_PKG_VERSION=${_PKG_MAJOR_VERSION}.1 +_PKG_MAJOR_VERSION=3.8 +TERMUX_PKG_VERSION=${_PKG_MAJOR_VERSION}.0 TERMUX_PKG_SRCURL=http://llvm.org/releases/${TERMUX_PKG_VERSION}/llvm-${TERMUX_PKG_VERSION}.src.tar.xz TERMUX_PKG_HOSTBUILD=true TERMUX_PKG_RM_AFTER_INSTALL="bin/macho-dump bin/bugpoint bin/llvm-tblgen lib/BugpointPasses.so lib/LLVMHello.so" diff --git a/packages/clang/dont-build-c-index-test.patch b/packages/clang/dont-build-c-index-test.patch index 3f4ce0af0..6558f9cf0 100644 --- a/packages/clang/dont-build-c-index-test.patch +++ b/packages/clang/dont-build-c-index-test.patch @@ -1,11 +1,11 @@ diff -u -r ../orig-src/tools/clang/tools/CMakeLists.txt ./tools/clang/tools/CMakeLists.txt ---- ../orig-src/tools/clang/tools/CMakeLists.txt 2014-03-06 11:07:50.000000000 +0100 -+++ ./tools/clang/tools/CMakeLists.txt 2014-03-06 11:06:10.000000000 +0100 -@@ -3,7 +3,6 @@ - add_subdirectory(clang-format) - add_subdirectory(clang-format-vs) +--- ../orig-src/tools/clang/tools/CMakeLists.txt 2016-01-12 21:03:50.000000000 -0500 ++++ ./tools/clang/tools/CMakeLists.txt 2016-03-10 16:32:04.320055824 -0500 +@@ -6,7 +6,6 @@ + add_clang_subdirectory(clang-format-vs) + add_clang_subdirectory(clang-fuzzer) --add_subdirectory(c-index-test) - add_subdirectory(libclang) +-add_clang_subdirectory(c-index-test) + add_clang_subdirectory(libclang) if(CLANG_ENABLE_ARCMT)