summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-devtools/strace/strace/0001-Ignore-pwritev-pwrite64-tests-on-musl.patch56
-rw-r--r--meta/recipes-devtools/strace/strace/0001-tests-fix-uio.test-with-musl-libc.patch30
-rw-r--r--meta/recipes-devtools/strace/strace_6.16.bb4
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 @@
1From 13fd22ad0df5b80c428d3ecc0114fb340f3b3894 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 18 Aug 2025 22:18:58 -0700
4Subject: [PATCH] Ignore pwritev/pwrite64 tests on musl
5
6musl uses wrappers for pwritev and pwrite64 using
7pwritev2 syscall [1], however the test exepcts that the
8program will call pwritev and pwrite64 ( glibc behavior )
9
10This can be fixed if the function calls are changed to
11use syscall() API directly, but that needs change upstream [2]
12
13Issue 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
19Upstream-Status: Inappropriate [Musl Specific]
20Signed-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 @@
1From 7fadf6947761cc5248aa4a376bb9517481dbaa52 Mon Sep 17 00:00:00 2001
2From: Gyorgy Sarvari <skandigraun@gmail.com>
3Date: Tue, 12 Aug 2025 20:02:31 +0200
4Subject: [PATCH] tests: fix uio.test with musl-libc
5
6musl-libc handles the pwrite calls differently than glibc, making
7the uio test fail. Using glibc, there are separated pwrite and pwritev
8calls, however musl uses only pwritev2 for both pwrite and pwritev.
9
10To account to this difference, modify the expected matching regexp
11to also match the musl output (append it with an OR).
12
13Upstream-Status: Backport [https://github.com/strace/strace/pull/347]
14Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
15Signed-off-by: Khem Raj <raj.khem@gmail.com>
16---
17 tests/uio.expected | 4 ++--
18 1 file changed, 2 insertions(+), 2 deletions(-)
19
20diff --git a/tests/uio.expected b/tests/uio.expected
21index 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 "
19SRC_URI:append:libc-musl = "\
20 file://0001-Ignore-pwritev-pwrite64-tests-on-musl.patch \
17 " 21 "
18SRC_URI[sha256sum] = "3d7aee7e4f044b2f67f3d51a8a76eda18076e9fb2774de54ac351d777d4ebffa" 22SRC_URI[sha256sum] = "3d7aee7e4f044b2f67f3d51a8a76eda18076e9fb2774de54ac351d777d4ebffa"
19 23