diff options
| author | Khem Raj <raj.khem@gmail.com> | 2025-08-20 23:45:23 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-08-25 17:47:20 +0100 |
| commit | 28eb7f66337bceee57b855b6e8112e6888dd02c2 (patch) | |
| tree | 3c1e84acc927f093467845a44185c2c345acf65f /meta/recipes-core/musl/libc-test | |
| parent | fa6f6b182c41730eaea688e4f1e000e6bf109bb1 (diff) | |
| download | poky-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.patch | 53 | ||||
| -rw-r--r-- | meta/recipes-core/musl/libc-test/0001-api-unistd-guard-optional-obsolete-_PC-_SC-constants.patch | 44 |
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 @@ | |||
| 1 | From df26c5206c3234fd2df924cff7ef540af1f2077c Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Tue, 19 Aug 2025 23:11:40 -0700 | ||
| 4 | Subject: [PATCH libc-test] Fix strptime on musl | ||
| 5 | MIME-Version: 1.0 | ||
| 6 | Content-Type: text/plain; charset=UTF-8 | ||
| 7 | Content-Transfer-Encoding: 8bit | ||
| 8 | |||
| 9 | musl parses the digits for %s but does not populate struct tm | ||
| 10 | (it's "parse-only" and intentionally has no effect on tm). | ||
| 11 | That's why you get a zeroed-out date like 1900-01-00T00:00:00. | ||
| 12 | This is current upstream behavior: | ||
| 13 | |||
| 14 | case 's': /* Parse only. Effect on tm is unspecified and presently no effect is implemented.. */ | ||
| 15 | |||
| 16 | musl's strptime only accepts ±hhmm for %z (e.g., -0600). | ||
| 17 | It does not accept ±hh or ±hh:mm. So '-06' fails by design. | ||
| 18 | It can be seen that upstream only checks 4 digits after the sign. | ||
| 19 | |||
| 20 | Upstream-Status: Submitted [https://www.openwall.com/lists/musl/2025/08/20/2] | ||
| 21 | Signed-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 | |||
| 27 | diff --git a/AUTHORS b/AUTHORS | ||
| 28 | index 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 | ||
| 36 | diff --git a/src/functional/strptime.c b/src/functional/strptime.c | ||
| 37 | index 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 @@ | |||
| 1 | From 90515d553d03d1f0bec8a4bdf03d02626d3968bb Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Tue, 19 Aug 2025 23:32:52 -0700 | ||
| 4 | Subject: [PATCH] api/unistd: guard optional/obsolete *_PC/*_SC constants for | ||
| 5 | musl | ||
| 6 | |||
| 7 | musl 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 | |||
| 11 | Build currently fails when these are referenced unconditionally. | ||
| 12 | Wrap the checks in #ifdef so the test compiles on musl without | ||
| 13 | claiming support for unavailable names. | ||
| 14 | |||
| 15 | Upstream-Status: Submitted [https://www.openwall.com/lists/musl/2025/08/20/3] | ||
| 16 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 17 | --- | ||
| 18 | src/api/unistd.c | 4 ++++ | ||
| 19 | 1 file changed, 4 insertions(+) | ||
| 20 | |||
| 21 | diff --git a/src/api/unistd.c b/src/api/unistd.c | ||
| 22 | index 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) | ||
