summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2022-08-16 09:58:56 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-08-17 19:57:32 +0100
commit7e10918724646a86afd4739ea136dac63d22def3 (patch)
tree671d6721e2c5c160ef602b190e559fda26f92d9e
parent59cc19b64d276c65cc915595870f18a2948c7182 (diff)
downloadpoky-7e10918724646a86afd4739ea136dac63d22def3.tar.gz
ltp: Fix sys/mount.h and linux/mount.h conflict
backport needed patches (From OE-Core rev: 4a8c73e8fe7ab7e1f06e9dbb32114447b20daa47) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-extended/ltp/ltp/0001-Remove-duplicate-include-of-sys-mount.h.patch30
-rw-r--r--meta/recipes-extended/ltp/ltp/0001-lapi-fsmount-resolve-conflict-in-different-header-fi.patch71
-rw-r--r--meta/recipes-extended/ltp/ltp/0001-lapi-pidfd-adding-pidfd-header-file.patch60
-rw-r--r--meta/recipes-extended/ltp/ltp_20220527.bb3
4 files changed, 133 insertions, 31 deletions
diff --git a/meta/recipes-extended/ltp/ltp/0001-Remove-duplicate-include-of-sys-mount.h.patch b/meta/recipes-extended/ltp/ltp/0001-Remove-duplicate-include-of-sys-mount.h.patch
deleted file mode 100644
index fc7fea02f9..0000000000
--- a/meta/recipes-extended/ltp/ltp/0001-Remove-duplicate-include-of-sys-mount.h.patch
+++ /dev/null
@@ -1,30 +0,0 @@
1From 463f3f85e326253feb35015a022ab6d1e03fe1d5 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 6 Aug 2022 20:50:27 -0700
4Subject: [PATCH] Remove duplicate include of <sys/mount.h>
5
6<sys/mount.h> is already included by lapi/mount.h.
7
8This fixes build with glibc 2.36+
9
10Upstream-Status: Submitted [https://github.com/linux-test-project/ltp/pull/953]
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 testcases/kernel/syscalls/statx/statx09.c | 1 -
14 1 file changed, 1 deletion(-)
15
16diff --git a/testcases/kernel/syscalls/statx/statx09.c b/testcases/kernel/syscalls/statx/statx09.c
17index aea329e086..34c5f41f87 100644
18--- a/testcases/kernel/syscalls/statx/statx09.c
19+++ b/testcases/kernel/syscalls/statx/statx09.c
20@@ -18,7 +18,6 @@
21 */
22
23 #define _GNU_SOURCE
24-#include <sys/mount.h>
25 #include <stdlib.h>
26 #include "tst_test.h"
27 #include "lapi/fs.h"
28--
292.37.1
30
diff --git a/meta/recipes-extended/ltp/ltp/0001-lapi-fsmount-resolve-conflict-in-different-header-fi.patch b/meta/recipes-extended/ltp/ltp/0001-lapi-fsmount-resolve-conflict-in-different-header-fi.patch
new file mode 100644
index 0000000000..cdbcf6b288
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0001-lapi-fsmount-resolve-conflict-in-different-header-fi.patch
@@ -0,0 +1,71 @@
1From b857f8723f30a4b9554bf6b0ff8fa52fd07e8b60 Mon Sep 17 00:00:00 2001
2From: Li Wang <liwang@redhat.com>
3Date: Fri, 5 Aug 2022 14:34:01 +0800
4Subject: [PATCH] lapi/fsmount: resolve conflict in different header files
5
6The latest glibc added new wrappers (e.g. mount_setattr, fsopen) support
7in sys/mount.h, which partly conflicts with linux/mount.h at the same time.
8
9We need to make adjustments to header files to fix compiling error on
10different platforms.
11
12Upstream-Status: Backport [https://github.com/linux-test-project/ltp/commit/b857f8723f30a4b9554bf6b0ff8fa52fd07e8b60]
13Signed-off-by: Li Wang <liwang@redhat.com>
14Reviewed-by: Petr Vorel <pvorel@suse.cz>
15---
16 configure.ac | 1 +
17 include/lapi/fs.h | 6 ++++--
18 include/lapi/fsmount.h | 7 +++++--
19 3 files changed, 10 insertions(+), 4 deletions(-)
20
21diff --git a/configure.ac b/configure.ac
22index d50ec1ea7..dbd53cab6 100644
23--- a/configure.ac
24+++ b/configure.ac
25@@ -113,6 +113,7 @@ AC_CHECK_FUNCS_ONCE([ \
26 mkdirat \
27 mknodat \
28 modify_ldt \
29+ mount_setattr \
30 move_mount \
31 name_to_handle_at \
32 open_tree \
33diff --git a/include/lapi/fs.h b/include/lapi/fs.h
34index 27b3a183c..84a168a67 100644
35--- a/include/lapi/fs.h
36+++ b/include/lapi/fs.h
37@@ -6,8 +6,10 @@
38 * Email: code@zilogic.com
39 */
40
41-#ifdef HAVE_LINUX_FS_H
42-# include <linux/fs.h>
43+#ifndef HAVE_MOUNT_SETATTR
44+# ifdef HAVE_LINUX_FS_H
45+# include <linux/fs.h>
46+# endif
47 #endif
48
49 #include <sys/user.h>
50diff --git a/include/lapi/fsmount.h b/include/lapi/fsmount.h
51index b11e7a7bd..07eb42ffa 100644
52--- a/include/lapi/fsmount.h
53+++ b/include/lapi/fsmount.h
54@@ -11,9 +11,12 @@
55 #include "config.h"
56 #include <sys/syscall.h>
57 #include <sys/types.h>
58+#include <sys/mount.h>
59
60-#ifdef HAVE_LINUX_MOUNT_H
61-# include <linux/mount.h>
62+#ifndef HAVE_FSOPEN
63+# ifdef HAVE_LINUX_MOUNT_H
64+# include <linux/mount.h>
65+# endif
66 #endif
67
68 #include "lapi/fcntl.h"
69--
702.37.2
71
diff --git a/meta/recipes-extended/ltp/ltp/0001-lapi-pidfd-adding-pidfd-header-file.patch b/meta/recipes-extended/ltp/ltp/0001-lapi-pidfd-adding-pidfd-header-file.patch
new file mode 100644
index 0000000000..184c42640a
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0001-lapi-pidfd-adding-pidfd-header-file.patch
@@ -0,0 +1,60 @@
1From dbc9c14c92a5acf450d07868a735ac8cd6ec5b90 Mon Sep 17 00:00:00 2001
2From: Li Wang <liwang@redhat.com>
3Date: Fri, 5 Aug 2022 14:34:00 +0800
4Subject: [PATCH] lapi/pidfd: adding pidfd header file
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9The newer Glibc already provided wrapper for the series pidfd syscall,
10so let's include the header file conditionally.
11
12 # rpm -q glibc-devel
13 glibc-devel-2.35.9000-31.fc37.ppc64le
14 # rpm -ql glibc-devel | grep pidfd
15 /usr/include/sys/pidfd.h
16
17To get rid of compiling error from fedora-rawhide:
18
19 tst_safe_macros.c: In function ‘safe_pidfd_open’:
20 tst_safe_macros.c:135:16: error: implicit declaration of function ‘pidfd_open’ [-Werror=implicit-function-declaration]
21 135 | rval = pidfd_open(pid, flags);
22 | ^~~~~~~~~~
23
24Upstream-Status: Backport [https://github.com/linux-test-project/ltp/commit/dbc9c14c92a5acf450d07868a735ac8cd6ec5b90]
25Signed-off-by: Li Wang <liwang@redhat.com>
26Reviewed-by: Petr Vorel <pvorel@suse.cz>
27---
28 configure.ac | 1 +
29 include/lapi/pidfd.h | 3 +++
30 2 files changed, 4 insertions(+)
31
32diff --git a/configure.ac b/configure.ac
33index 69b145b5f..d50ec1ea7 100644
34--- a/configure.ac
35+++ b/configure.ac
36@@ -71,6 +71,7 @@ AC_CHECK_HEADERS_ONCE([ \
37 sys/epoll.h \
38 sys/fanotify.h \
39 sys/inotify.h \
40+ sys/pidfd.h
41 sys/prctl.h \
42 sys/shm.h \
43 sys/timerfd.h \
44diff --git a/include/lapi/pidfd.h b/include/lapi/pidfd.h
45index 244d3acaf..9ca8e5aa2 100644
46--- a/include/lapi/pidfd.h
47+++ b/include/lapi/pidfd.h
48@@ -8,6 +8,9 @@
49 #define LAPI_PIDFD_H__
50
51 #include <fcntl.h>
52+#ifdef HAVE_SYS_PIDFD_H
53+# include <sys/pidfd.h>
54+#endif
55 #include "config.h"
56 #include "lapi/syscalls.h"
57
58--
592.37.2
60
diff --git a/meta/recipes-extended/ltp/ltp_20220527.bb b/meta/recipes-extended/ltp/ltp_20220527.bb
index 6d812958cd..a547298828 100644
--- a/meta/recipes-extended/ltp/ltp_20220527.bb
+++ b/meta/recipes-extended/ltp/ltp_20220527.bb
@@ -37,7 +37,8 @@ SRC_URI = "git://github.com/linux-test-project/ltp.git;branch=master;protocol=ht
37 file://0001-netstress-Restore-runtime-to-5m.patch \ 37 file://0001-netstress-Restore-runtime-to-5m.patch \
38 file://0001-net_stress-Fix-usage-of-variables-from-tst_net.sh.patch \ 38 file://0001-net_stress-Fix-usage-of-variables-from-tst_net.sh.patch \
39 file://0001-memcg-functional-Fix-usage-of-PAGESIZE-from-memcg_li.patch \ 39 file://0001-memcg-functional-Fix-usage-of-PAGESIZE-from-memcg_li.patch \
40 file://0001-Remove-duplicate-include-of-sys-mount.h.patch \ 40 file://0001-lapi-pidfd-adding-pidfd-header-file.patch \
41 file://0001-lapi-fsmount-resolve-conflict-in-different-header-fi.patch \
41 " 42 "
42 43
43S = "${WORKDIR}/git" 44S = "${WORKDIR}/git"