From b5219f720c45ac5b7c29f6bfc4de9c0232aada6d Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Wed, 16 Jan 2019 21:50:17 +0100 Subject: [PATCH] Patch TCSAFLUSH to be TCSANOW --- build-package.sh | 2 +- ndk-patches/asm-generic-termbits.h.patch | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 ndk-patches/asm-generic-termbits.h.patch diff --git a/build-package.sh b/build-package.sh index 2b1c214bf..b7a79bf07 100755 --- a/build-package.sh +++ b/build-package.sh @@ -431,7 +431,7 @@ termux_step_start_build() { TERMUX_STANDALONE_TOOLCHAIN="$TERMUX_COMMON_CACHEDIR/${TERMUX_NDK_VERSION}-${TERMUX_ARCH}-${TERMUX_PKG_API_LEVEL}" # Bump the below version if a change is made in toolchain setup to ensure # that everyone gets an updated toolchain: - TERMUX_STANDALONE_TOOLCHAIN+="-v1" + TERMUX_STANDALONE_TOOLCHAIN+="-v2" if [ -n "${TERMUX_PKG_BLACKLISTED_ARCHES:=""}" ] && [ "$TERMUX_PKG_BLACKLISTED_ARCHES" != "${TERMUX_PKG_BLACKLISTED_ARCHES/$TERMUX_ARCH/}" ]; then echo "Skipping building $TERMUX_PKG_NAME for arch $TERMUX_ARCH" diff --git a/ndk-patches/asm-generic-termbits.h.patch b/ndk-patches/asm-generic-termbits.h.patch new file mode 100644 index 000000000..6b4ecb4dd --- /dev/null +++ b/ndk-patches/asm-generic-termbits.h.patch @@ -0,0 +1,11 @@ +diff -u -r /home/builder/lib/android-ndk/sysroot/usr/include/asm-generic/termbits.h ./usr/include/asm-generic/termbits.h +--- /home/builder/lib/android-ndk/sysroot/usr/include/asm-generic/termbits.h 2018-09-10 17:37:50.000000000 +0000 ++++ ./usr/include/asm-generic/termbits.h 2019-01-16 04:54:01.117253378 +0000 +@@ -190,5 +190,6 @@ + #define TCIOFLUSH 2 + #define TCSANOW 0 + #define TCSADRAIN 1 +-#define TCSAFLUSH 2 ++/* TCSAFLUSH is patched to be TCSANOW in Termux to work around Android SELinux rule */ ++#define TCSAFLUSH 0 + #endif