diff mbox series

[v2,1/9] m4: Fix ptest on musl

Message ID 20250821064528.754633-1-raj.khem@gmail.com
State New
Headers show
Series [v2,1/9] m4: Fix ptest on musl | expand

Commit Message

Khem Raj Aug. 21, 2025, 6:45 a.m. UTC
Fixes
../../sources/m4-1.4.20/tests/test-c32ispunct.c:261: assertion 'is == 0' failed
./test-c32ispunct.sh: line 36:   402 Aborted
(core dumped) LC_ALL="$testlocale" ${CHECKER} ./test-c32ispunct${EXEEXT} 3

FAIL: test-c32ispunct.sh

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
v2: apply the patch only for the target case

 meta/recipes-devtools/m4/m4-1.4.20.inc        |  1 +
 ...unct-Check-for-musl-along-with-glibc.patch | 26 +++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 meta/recipes-devtools/m4/m4/0001-test-c32ispunct-Check-for-musl-along-with-glibc.patch
diff mbox series

Patch

diff --git a/meta/recipes-devtools/m4/m4-1.4.20.inc b/meta/recipes-devtools/m4/m4-1.4.20.inc
index aad57b8b649..5c4ba09288c 100644
--- a/meta/recipes-devtools/m4/m4-1.4.20.inc
+++ b/meta/recipes-devtools/m4/m4-1.4.20.inc
@@ -10,6 +10,7 @@  SRC_URI = "${GNU_MIRROR}/m4/m4-${PV}.tar.gz \
            file://0001-gettext-h-Avoid-gcc-Wformat-security-warnings-with-d.patch \
            "
 SRC_URI:append:class-target = " file://run-ptest \
+                                file://0001-test-c32ispunct-Check-for-musl-along-with-glibc.patch \
                                 file://serial-tests-config.patch \
                               "
 
diff --git a/meta/recipes-devtools/m4/m4/0001-test-c32ispunct-Check-for-musl-along-with-glibc.patch b/meta/recipes-devtools/m4/m4/0001-test-c32ispunct-Check-for-musl-along-with-glibc.patch
new file mode 100644
index 00000000000..fb03e94c52d
--- /dev/null
+++ b/meta/recipes-devtools/m4/m4/0001-test-c32ispunct-Check-for-musl-along-with-glibc.patch
@@ -0,0 +1,26 @@ 
+From 761aa7fab4a82dc01daa28799f4f1d6ae17a4c26 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 18 Aug 2025 11:31:32 -0700
+Subject: [PATCH] test-c32ispunct: Check for musl along with glibc
+
+This check crashes on musl based locales, other libcs
+e.g. glibc ignore it too.
+
+Upstream-Status: Submitted [https://lists.gnu.org/archive/html/m4-patches/2025-08/msg00000.html]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ tests/test-c32ispunct.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/tests/test-c32ispunct.c
++++ b/tests/test-c32ispunct.c
+@@ -255,7 +255,7 @@ main (int argc, char *argv[])
+           is = for_character ("\360\235\204\200", 4);
+           ASSERT (is != 0);
+         #endif
+-        #if !(defined __GLIBC__ || (defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ || defined _AIX || defined __sun || defined __CYGWIN__ || (defined _WIN32 && !defined __CYGWIN__) || defined __ANDROID__)
++        #if !(defined __GLIBC__ || defined MUSL_LIBC || (defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ || defined _AIX || defined __sun || defined __CYGWIN__ || (defined _WIN32 && !defined __CYGWIN__) || defined __ANDROID__)
+           /* U+E003A TAG COLON */
+           is = for_character ("\363\240\200\272", 4);
+           ASSERT (is == 0);