summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/musl/libc-test
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2025-08-20 23:45:23 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-08-25 17:47:20 +0100
commit28eb7f66337bceee57b855b6e8112e6888dd02c2 (patch)
tree3c1e84acc927f093467845a44185c2c345acf65f /meta/recipes-core/musl/libc-test
parentfa6f6b182c41730eaea688e4f1e000e6bf109bb1 (diff)
downloadpoky-28eb7f66337bceee57b855b6e8112e6888dd02c2.tar.gz
libc-test: Fix strptime and api/main tests
(From OE-Core rev: 124921683e9a0a1d981eaeea717c5dd7d35abf90) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/musl/libc-test')
-rw-r--r--meta/recipes-core/musl/libc-test/0001-Fix-strptime-on-musl.patch53
-rw-r--r--meta/recipes-core/musl/libc-test/0001-api-unistd-guard-optional-obsolete-_PC-_SC-constants.patch44
2 files changed, 97 insertions, 0 deletions
diff --git a/meta/recipes-core/musl/libc-test/0001-Fix-strptime-on-musl.patch b/meta/recipes-core/musl/libc-test/0001-Fix-strptime-on-musl.patch
new file mode 100644
index 0000000000..4c3a2cb21f
--- /dev/null
+++ b/meta/recipes-core/musl/libc-test/0001-Fix-strptime-on-musl.patch
@@ -0,0 +1,53 @@
1From df26c5206c3234fd2df924cff7ef540af1f2077c Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 19 Aug 2025 23:11:40 -0700
4Subject: [PATCH libc-test] Fix strptime on musl
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9musl parses the digits for %s but does not populate struct tm
10(it's "parse-only" and intentionally has no effect on tm).
11That's why you get a zeroed-out date like 1900-01-00T00:00:00.
12This is current upstream behavior:
13
14case 's': /* Parse only. Effect on tm is unspecified and presently no effect is implemented.. */
15
16musl's strptime only accepts ±hhmm for %z (e.g., -0600).
17It does not accept ±hh or ±hh:mm. So '-06' fails by design.
18It can be seen that upstream only checks 4 digits after the sign.
19
20Upstream-Status: Submitted [https://www.openwall.com/lists/musl/2025/08/20/2]
21Signed-off-by: Khem Raj <raj.khem@gmail.com>
22---
23 AUTHORS | 1 +
24 src/functional/strptime.c | 4 +++-
25 2 files changed, 4 insertions(+), 1 deletion(-)
26
27diff --git a/AUTHORS b/AUTHORS
28index cf2a394..5e78ef7 100644
29--- a/AUTHORS
30+++ b/AUTHORS
31@@ -6,3 +6,4 @@ Jens Gustedt
32 Alexander Monakov
33 Julien Ramseier
34 Alyssa Ross
35+Khem Raj
36diff --git a/src/functional/strptime.c b/src/functional/strptime.c
37index b5f8977..f76fa68 100644
38--- a/src/functional/strptime.c
39+++ b/src/functional/strptime.c
40@@ -109,10 +109,12 @@ int main() {
41
42 /* Glibc */
43 checkStrptime("1856-07-10", "%F", &tm4);
44+#ifdef __GLIBC__
45 checkStrptime("683078400", "%s", &tm2);
46+#endif
47 checkStrptimeTz("+0200", 2, 0);
48 checkStrptimeTz("-0530", -5, -30);
49- checkStrptimeTz("-06", -6, 0);
50+ checkStrptimeTz("-0600", -6, 0);
51
52 return t_status;
53 }
diff --git a/meta/recipes-core/musl/libc-test/0001-api-unistd-guard-optional-obsolete-_PC-_SC-constants.patch b/meta/recipes-core/musl/libc-test/0001-api-unistd-guard-optional-obsolete-_PC-_SC-constants.patch
new file mode 100644
index 0000000000..f568595319
--- /dev/null
+++ b/meta/recipes-core/musl/libc-test/0001-api-unistd-guard-optional-obsolete-_PC-_SC-constants.patch
@@ -0,0 +1,44 @@
1From 90515d553d03d1f0bec8a4bdf03d02626d3968bb Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 19 Aug 2025 23:32:52 -0700
4Subject: [PATCH] api/unistd: guard optional/obsolete *_PC/*_SC constants for
5 musl
6
7musl does not define some POSIX option macros:
8- _SC_XOPEN_UUCP is obsolete and absent on musl
9- _PC_TIMESTAMP_RESOLUTION is optional and may be undefined
10
11Build currently fails when these are referenced unconditionally.
12Wrap the checks in #ifdef so the test compiles on musl without
13claiming support for unavailable names.
14
15Upstream-Status: Submitted [https://www.openwall.com/lists/musl/2025/08/20/3]
16Signed-off-by: Khem Raj <raj.khem@gmail.com>
17---
18 src/api/unistd.c | 4 ++++
19 1 file changed, 4 insertions(+)
20
21diff --git a/src/api/unistd.c b/src/api/unistd.c
22index 522ccdc..0de547b 100644
23--- a/src/api/unistd.c
24+++ b/src/api/unistd.c
25@@ -114,7 +114,9 @@ C(_PC_REC_MIN_XFER_SIZE)
26 C(_PC_REC_XFER_ALIGN)
27 C(_PC_SYMLINK_MAX)
28 C(_PC_SYNC_IO)
29+#ifdef _PC_TIMESTAMP_RESOLUTION
30 C(_PC_TIMESTAMP_RESOLUTION)
31+#endif
32 C(_PC_VDISABLE)
33 C(_SC_2_C_BIND)
34 C(_SC_2_C_DEV)
35@@ -235,7 +237,9 @@ C(_SC_XOPEN_REALTIME_THREADS)
36 C(_SC_XOPEN_SHM)
37 C(_SC_XOPEN_STREAMS)
38 C(_SC_XOPEN_UNIX)
39+#ifdef _SC_XOPEN_UUCP
40 C(_SC_XOPEN_UUCP)
41+#endif
42 C(_SC_XOPEN_VERSION)
43 C(STDERR_FILENO)
44 C(STDIN_FILENO)