ndk-patches: Patch to 'define MB_CUR_MAX 4'

The platform headers has the following macro:

  #define MB_CUR_MAX __ctype_get_mb_cur_max()

where __ctype_get_mb_cur_max() tries to handle UTF-8 encodings.

However, even in Android 7.0 setlocale(LC_ALL, ""), which many
programs do at startup, doesn't work in that it sets the locale
as non-utf8:

  https://android.googlesource.com/platform/bionic/+/nougat-release/libc/bionic/locale.cpp#139

So we just always consider us being in an utf-8 locale.

Also rebuild coreutils to fix #1136.
This commit is contained in:
Fredrik Fornwall 2017-07-16 12:36:06 +02:00
parent cfef68b8ac
commit a328a50407
3 changed files with 13 additions and 3 deletions

View File

@ -295,7 +295,7 @@ termux_step_start_build() {
TERMUX_STANDALONE_TOOLCHAIN="$TERMUX_TOPDIR/_lib/${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+="-v9"
TERMUX_STANDALONE_TOOLCHAIN+="-v10"
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"

View File

@ -1,6 +1,6 @@
diff -u -r /home/fornwall/lib/android-ndk/sysroot/usr/include/stdlib.h ./usr/include/stdlib.h
--- /home/fornwall/lib/android-ndk/sysroot/usr/include/stdlib.h 2017-06-20 17:41:56.000000000 +0200
+++ ./usr/include/stdlib.h 2017-07-01 01:50:17.192362546 +0200
+++ ./usr/include/stdlib.h 2017-07-16 12:30:31.724463111 +0200
@@ -35,6 +35,7 @@
#include <alloca.h>
#include <malloc.h>
@ -9,3 +9,13 @@ diff -u -r /home/fornwall/lib/android-ndk/sysroot/usr/include/stdlib.h ./usr/inc
__BEGIN_DECLS
@@ -210,8 +211,7 @@
size_t wcstombs(char*, const wchar_t*, size_t);
#if __ANDROID_API__ >= __ANDROID_API_L__
-size_t __ctype_get_mb_cur_max(void) __INTRODUCED_IN(21);
-#define MB_CUR_MAX __ctype_get_mb_cur_max()
+#define MB_CUR_MAX 4
#else
/*
* Pre-L we didn't have any locale support and so we were always the POSIX

View File

@ -1,7 +1,7 @@
TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/coreutils/
TERMUX_PKG_DESCRIPTION="Basic file, shell and text manipulation utilities from the GNU project"
TERMUX_PKG_VERSION=8.27
TERMUX_PKG_REVISION=3
TERMUX_PKG_REVISION=4
TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/coreutils/coreutils-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=8891d349ee87b9ff7870f52b6d9312a9db672d2439d289bc57084771ca21656b
# pinky has no usage on Android.