diff options
| author | Khem Raj <raj.khem@gmail.com> | 2025-08-19 09:02:44 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-08-21 10:29:56 +0100 |
| commit | e7423ae09e62a1f5f72391e61cad2381f917c113 (patch) | |
| tree | a8411e232e0a9a24258168d17e0efa36b96067c9 /meta | |
| parent | 9bdc31dcc92094609a386e1fa4f8ced798bb5413 (diff) | |
| download | poky-e7423ae09e62a1f5f72391e61cad2381f917c113.tar.gz | |
strace: Fix uio test and ignore pwritev|pwrite64 tests on musl
The pwritev and pwrite64 are wrappers over pwritev2 syscall in
musl but strace assumes glibc behavior, ignore them for now
(From OE-Core rev: 38f4f3bfbe2f9625737af15422423b00c32ee076)
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')
3 files changed, 90 insertions, 0 deletions
diff --git a/meta/recipes-devtools/strace/strace/0001-Ignore-pwritev-pwrite64-tests-on-musl.patch b/meta/recipes-devtools/strace/strace/0001-Ignore-pwritev-pwrite64-tests-on-musl.patch new file mode 100644 index 0000000000..f21f68001f --- /dev/null +++ b/meta/recipes-devtools/strace/strace/0001-Ignore-pwritev-pwrite64-tests-on-musl.patch | |||
| @@ -0,0 +1,56 @@ | |||
| 1 | From 13fd22ad0df5b80c428d3ecc0114fb340f3b3894 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Mon, 18 Aug 2025 22:18:58 -0700 | ||
| 4 | Subject: [PATCH] Ignore pwritev/pwrite64 tests on musl | ||
| 5 | |||
| 6 | musl uses wrappers for pwritev and pwrite64 using | ||
| 7 | pwritev2 syscall [1], however the test exepcts that the | ||
| 8 | program will call pwritev and pwrite64 ( glibc behavior ) | ||
| 9 | |||
| 10 | This can be fixed if the function calls are changed to | ||
| 11 | use syscall() API directly, but that needs change upstream [2] | ||
| 12 | |||
| 13 | Issue is reported upstream [3] | ||
| 14 | |||
| 15 | [1] https://git.musl-libc.org/cgit/musl/commit/src?id=5370070fded61b569196764673a4fc8440aac79e | ||
| 16 | [2] https://github.com/strace/strace/pull/347 | ||
| 17 | [3] https://github.com/strace/strace/issues/349 | ||
| 18 | |||
| 19 | Upstream-Status: Inappropriate [Musl Specific] | ||
| 20 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 21 | --- | ||
| 22 | tests/pread64-pwrite64.gen.test | 2 ++ | ||
| 23 | tests/preadv-pwritev.gen.test | 2 ++ | ||
| 24 | tests/pwritev.gen.test | 2 ++ | ||
| 25 | 3 files changed, 6 insertions(+) | ||
| 26 | |||
| 27 | --- a/tests/pread64-pwrite64.gen.test | ||
| 28 | +++ b/tests/pread64-pwrite64.gen.test | ||
| 29 | @@ -1,4 +1,7 @@ | ||
| 30 | #!/bin/sh -efu | ||
| 31 | # Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (pread64-pwrite64 -a21 -eread=0 -ewrite=1 -e trace=pread64,pwrite64 -P pread64-pwrite64-tmpfile -P /dev/zero -P /dev/null); do not edit. | ||
| 32 | . "${srcdir=.}/init.sh" | ||
| 33 | + | ||
| 34 | +skip_ "Test not ported to musl, musl generates pwritev2" | ||
| 35 | + | ||
| 36 | run_strace_match_diff -a21 -eread=0 -ewrite=1 -e trace=pread64,pwrite64 -P pread64-pwrite64-tmpfile -P /dev/zero -P /dev/null | ||
| 37 | --- a/tests/preadv-pwritev.gen.test | ||
| 38 | +++ b/tests/preadv-pwritev.gen.test | ||
| 39 | @@ -1,4 +1,7 @@ | ||
| 40 | #!/bin/sh -efu | ||
| 41 | # Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (preadv-pwritev -a19 -eread=0 -ewrite=1 -e trace=preadv,pwritev); do not edit. | ||
| 42 | . "${srcdir=.}/init.sh" | ||
| 43 | + | ||
| 44 | +skip_ "Test not ported to musl, musl generates pwritev2" | ||
| 45 | + | ||
| 46 | run_strace_match_diff -a19 -eread=0 -ewrite=1 -e trace=preadv,pwritev | ||
| 47 | --- a/tests/pwritev.gen.test | ||
| 48 | +++ b/tests/pwritev.gen.test | ||
| 49 | @@ -1,4 +1,7 @@ | ||
| 50 | #!/bin/sh -efu | ||
| 51 | # Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (pwritev -a22 -s7); do not edit. | ||
| 52 | . "${srcdir=.}/init.sh" | ||
| 53 | + | ||
| 54 | +skip_ "Test not ported to musl, musl generates pwritev2" | ||
| 55 | + | ||
| 56 | run_strace_match_diff -a22 -s7 | ||
diff --git a/meta/recipes-devtools/strace/strace/0001-tests-fix-uio.test-with-musl-libc.patch b/meta/recipes-devtools/strace/strace/0001-tests-fix-uio.test-with-musl-libc.patch new file mode 100644 index 0000000000..a879ca50ca --- /dev/null +++ b/meta/recipes-devtools/strace/strace/0001-tests-fix-uio.test-with-musl-libc.patch | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | From 7fadf6947761cc5248aa4a376bb9517481dbaa52 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Gyorgy Sarvari <skandigraun@gmail.com> | ||
| 3 | Date: Tue, 12 Aug 2025 20:02:31 +0200 | ||
| 4 | Subject: [PATCH] tests: fix uio.test with musl-libc | ||
| 5 | |||
| 6 | musl-libc handles the pwrite calls differently than glibc, making | ||
| 7 | the uio test fail. Using glibc, there are separated pwrite and pwritev | ||
| 8 | calls, however musl uses only pwritev2 for both pwrite and pwritev. | ||
| 9 | |||
| 10 | To account to this difference, modify the expected matching regexp | ||
| 11 | to also match the musl output (append it with an OR). | ||
| 12 | |||
| 13 | Upstream-Status: Backport [https://github.com/strace/strace/pull/347] | ||
| 14 | Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> | ||
| 15 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 16 | --- | ||
| 17 | tests/uio.expected | 4 ++-- | ||
| 18 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
| 19 | |||
| 20 | diff --git a/tests/uio.expected b/tests/uio.expected | ||
| 21 | index 98d5c06..2a712a1 100644 | ||
| 22 | --- a/tests/uio.expected | ||
| 23 | +++ b/tests/uio.expected | ||
| 24 | @@ -1,4 +1,4 @@ | ||
| 25 | pread(64)?\(0, "\\0\\0\\0\\0", 4, 1004211379570065135\) += 4 | ||
| 26 | preadv\(0, \[\{iov_base="\\0\\0\\0\\0", iov_len=4\}\], 1, 1004211379570065135\) += 4 | ||
| 27 | -pwrite(64)?\(0, "\\0\\0\\0\\0", 4, 1004211379570065135\) += 4 | ||
| 28 | -pwritev\(0, \[\{iov_base="\\0\\0\\0\\0", iov_len=4\}\], 1, 1004211379570065135\) += 4 | ||
| 29 | +pwrite(64)?\(0, "\\0\\0\\0\\0", 4, 1004211379570065135\) += 4|pwritev2\(0, \[\{iov_base="\\0\\0\\0\\0", iov_len=4}], 1, 1004211379570065135, RWF_NOAPPEND\) += 4 | ||
| 30 | +pwritev\(0, \[\{iov_base="\\0\\0\\0\\0", iov_len=4\}\], 1, 1004211379570065135\) += 4|pwritev2\(0, \[\{iov_base="\\0\\0\\0\\0", iov_len=4}], 1, 1004211379570065135, RWF_NOAPPEND\) += 4 | ||
diff --git a/meta/recipes-devtools/strace/strace_6.16.bb b/meta/recipes-devtools/strace/strace_6.16.bb index 3e6b855df0..0552caa2b6 100644 --- a/meta/recipes-devtools/strace/strace_6.16.bb +++ b/meta/recipes-devtools/strace/strace_6.16.bb | |||
| @@ -14,6 +14,10 @@ SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/strace-${PV}.tar.xz \ | |||
| 14 | file://skip-load.patch \ | 14 | file://skip-load.patch \ |
| 15 | file://0001-configure-Use-autoconf-macro-to-detect-largefile-sup.patch \ | 15 | file://0001-configure-Use-autoconf-macro-to-detect-largefile-sup.patch \ |
| 16 | file://0002-tests-Replace-off64_t-with-off_t.patch \ | 16 | file://0002-tests-Replace-off64_t-with-off_t.patch \ |
| 17 | file://0001-tests-fix-uio.test-with-musl-libc.patch \ | ||
| 18 | " | ||
| 19 | SRC_URI:append:libc-musl = "\ | ||
| 20 | file://0001-Ignore-pwritev-pwrite64-tests-on-musl.patch \ | ||
| 17 | " | 21 | " |
| 18 | SRC_URI[sha256sum] = "3d7aee7e4f044b2f67f3d51a8a76eda18076e9fb2774de54ac351d777d4ebffa" | 22 | SRC_URI[sha256sum] = "3d7aee7e4f044b2f67f3d51a8a76eda18076e9fb2774de54ac351d777d4ebffa" |
| 19 | 23 | ||
