From bbf6c555140fa315989fcc32b63e9c3e2bed6b16 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Wed, 2 Oct 2019 21:52:02 +0200 Subject: [PATCH] m4: Patch to work on Android 10 The old version of gnulib that m4 uses tries to use the %n printf modifier which aborts the process on Android 10 onwards. Fixes #4381 (thanks easyaspi314). --- packages/m4/build.sh | 2 +- packages/m4/lib-vasnprintf.c.patch | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 packages/m4/lib-vasnprintf.c.patch diff --git a/packages/m4/build.sh b/packages/m4/build.sh index d362ba472..25332e5da 100644 --- a/packages/m4/build.sh +++ b/packages/m4/build.sh @@ -2,7 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/m4/m4.html TERMUX_PKG_DESCRIPTION="Traditional Unix macro processor" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_VERSION=1.4.18 -TERMUX_PKG_REVISION=2 +TERMUX_PKG_REVISION=3 TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/m4/m4-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07 TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" diff --git a/packages/m4/lib-vasnprintf.c.patch b/packages/m4/lib-vasnprintf.c.patch new file mode 100644 index 000000000..095184b5b --- /dev/null +++ b/packages/m4/lib-vasnprintf.c.patch @@ -0,0 +1,12 @@ +diff -u -r ../m4-1.4.18/lib/vasnprintf.c ./lib/vasnprintf.c +--- ../m4-1.4.18/lib/vasnprintf.c 2016-12-31 13:54:42.000000000 +0000 ++++ ./lib/vasnprintf.c 2019-10-02 19:32:13.576211922 +0000 +@@ -4858,7 +4858,7 @@ + #endif + *fbp = dp->conversion; + #if USE_SNPRINTF +-# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) ++# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) || defined(__ANDROID__)) + fbp[1] = '%'; + fbp[2] = 'n'; + fbp[3] = '\0';