From: Martin Cermak Date: Fri, 10 Apr 2026 13:02:40 +0000 (+0200) Subject: Testsuite: Patch the LTP sources to fix compile time problem X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;p=thirdparty%2Fvalgrind.git Testsuite: Patch the LTP sources to fix compile time problem Patch ltp-full-20260130.tar to fix openat2() compile time problem. --- diff --git a/NEWS b/NEWS index b5b81586d..231ce7a9c 100644 --- a/NEWS +++ b/NEWS @@ -121,6 +121,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 518078 Configure should accept names for GDB other than "gdb" 518159 pth_once issues on Darwin 518482 FreeBSD: assert in parse_procselfmaps when built with GNU binutils +518778 Valgrind LTP testsuite fails to compile on Fedora 44+ To see details of a given bug, visit https://bugs.kde.org/show_bug.cgi?id=XXXXXX diff --git a/auxprogs/Makefile.am b/auxprogs/Makefile.am index 8099331cb..f5be90eb1 100644 --- a/auxprogs/Makefile.am +++ b/auxprogs/Makefile.am @@ -21,7 +21,8 @@ LTP_FILTERS = \ filters/select03 \ filters/munmap01 -LTP_PATCHES = +LTP_PATCHES = \ + ltp-patches/openat2.patch EXTRA_DIST = \ docs/valgrind-listener-manpage.xml \ diff --git a/auxprogs/ltp-patches/openat2.patch b/auxprogs/ltp-patches/openat2.patch new file mode 100644 index 000000000..74375ccc6 --- /dev/null +++ b/auxprogs/ltp-patches/openat2.patch @@ -0,0 +1,73 @@ +commit 767b3e519e85095dfee3a47d15a373a403fe3dab +Author: Li Wang +Date: Tue Feb 3 10:43:19 2026 +0800 + + openat2: define _GNU_SOURCE and include + + On Fedora Rawhide (glibc 2.43+), libc exposes openat2() and struct open_how, + so our configure script defines HAVE_OPENAT2 and the fallback definition in + lapi/openat2.h gets skipped. But openat20*.c never included (and + lacked _GNU_SOURCE), so the libc-provided prototype and struct stayed hidden, + so compilation failed: + + # uname -r + 6.18.0-65.fc44.x86_64 + + # rpm -qf /usr/include/fcntl.h + glibc-devel-2.43-1.fc44.x86_64 + + # nm -D /usr/lib64/libc.so.6 | grep -w openat2 + 00000000000eb890 W openat2@@GLIBC_2.43 + + # make -C testcase/kernel/syscalls/openat2 + openat201.c:27:62: error: invalid application of ‘sizeof’ to incomplete type ‘struct open_how’ + 27 | {&dir_fd, TEST_FILE, O_RDWR, S_IRWXU, 0, &how, sizeof(*how)}, + + Define _GNU_SOURCE and include in openat2 tests to make the + prototype available and fix the build. + + Signed-off-by: Li Wang + Reviewed-by: Petr Vorel + +diff --git a/testcases/kernel/syscalls/openat2/openat201.c b/testcases/kernel/syscalls/openat2/openat201.c +index ecd63b150..40ac2f6d9 100644 +--- a/testcases/kernel/syscalls/openat2/openat201.c ++++ b/testcases/kernel/syscalls/openat2/openat201.c +@@ -4,6 +4,9 @@ + * + * Basic openat2() test. + */ ++#define _GNU_SOURCE ++#include ++ + #include "tst_test.h" + #include "lapi/openat2.h" + +diff --git a/testcases/kernel/syscalls/openat2/openat202.c b/testcases/kernel/syscalls/openat2/openat202.c +index 6d1b5a67c..329c6a4a5 100644 +--- a/testcases/kernel/syscalls/openat2/openat202.c ++++ b/testcases/kernel/syscalls/openat2/openat202.c +@@ -4,6 +4,9 @@ + * + * openat2() tests with various resolve flags. + */ ++#define _GNU_SOURCE ++#include ++ + #include "tst_test.h" + #include "lapi/openat2.h" + +diff --git a/testcases/kernel/syscalls/openat2/openat203.c b/testcases/kernel/syscalls/openat2/openat203.c +index 6ac49ef4c..cd0c00d75 100644 +--- a/testcases/kernel/syscalls/openat2/openat203.c ++++ b/testcases/kernel/syscalls/openat2/openat203.c +@@ -4,6 +4,9 @@ + * + * Basic openat2() test to check various failures. + */ ++#define _GNU_SOURCE ++#include ++ + #include "tst_test.h" + #include "lapi/openat2.h" +