diff options
author | Khem Raj <raj.khem@gmail.com> | 2022-08-16 09:58:56 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-08-17 19:57:32 +0100 |
commit | 7e10918724646a86afd4739ea136dac63d22def3 (patch) | |
tree | 671d6721e2c5c160ef602b190e559fda26f92d9e | |
parent | 59cc19b64d276c65cc915595870f18a2948c7182 (diff) | |
download | poky-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>
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 @@ | |||
1 | From 463f3f85e326253feb35015a022ab6d1e03fe1d5 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sat, 6 Aug 2022 20:50:27 -0700 | ||
4 | Subject: [PATCH] Remove duplicate include of <sys/mount.h> | ||
5 | |||
6 | <sys/mount.h> is already included by lapi/mount.h. | ||
7 | |||
8 | This fixes build with glibc 2.36+ | ||
9 | |||
10 | Upstream-Status: Submitted [https://github.com/linux-test-project/ltp/pull/953] | ||
11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
12 | --- | ||
13 | testcases/kernel/syscalls/statx/statx09.c | 1 - | ||
14 | 1 file changed, 1 deletion(-) | ||
15 | |||
16 | diff --git a/testcases/kernel/syscalls/statx/statx09.c b/testcases/kernel/syscalls/statx/statx09.c | ||
17 | index 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 | -- | ||
29 | 2.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 @@ | |||
1 | From b857f8723f30a4b9554bf6b0ff8fa52fd07e8b60 Mon Sep 17 00:00:00 2001 | ||
2 | From: Li Wang <liwang@redhat.com> | ||
3 | Date: Fri, 5 Aug 2022 14:34:01 +0800 | ||
4 | Subject: [PATCH] lapi/fsmount: resolve conflict in different header files | ||
5 | |||
6 | The latest glibc added new wrappers (e.g. mount_setattr, fsopen) support | ||
7 | in sys/mount.h, which partly conflicts with linux/mount.h at the same time. | ||
8 | |||
9 | We need to make adjustments to header files to fix compiling error on | ||
10 | different platforms. | ||
11 | |||
12 | Upstream-Status: Backport [https://github.com/linux-test-project/ltp/commit/b857f8723f30a4b9554bf6b0ff8fa52fd07e8b60] | ||
13 | Signed-off-by: Li Wang <liwang@redhat.com> | ||
14 | Reviewed-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 | |||
21 | diff --git a/configure.ac b/configure.ac | ||
22 | index 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 \ | ||
33 | diff --git a/include/lapi/fs.h b/include/lapi/fs.h | ||
34 | index 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> | ||
50 | diff --git a/include/lapi/fsmount.h b/include/lapi/fsmount.h | ||
51 | index 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 | -- | ||
70 | 2.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 @@ | |||
1 | From dbc9c14c92a5acf450d07868a735ac8cd6ec5b90 Mon Sep 17 00:00:00 2001 | ||
2 | From: Li Wang <liwang@redhat.com> | ||
3 | Date: Fri, 5 Aug 2022 14:34:00 +0800 | ||
4 | Subject: [PATCH] lapi/pidfd: adding pidfd header file | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | The newer Glibc already provided wrapper for the series pidfd syscall, | ||
10 | so 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 | |||
17 | To 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 | |||
24 | Upstream-Status: Backport [https://github.com/linux-test-project/ltp/commit/dbc9c14c92a5acf450d07868a735ac8cd6ec5b90] | ||
25 | Signed-off-by: Li Wang <liwang@redhat.com> | ||
26 | Reviewed-by: Petr Vorel <pvorel@suse.cz> | ||
27 | --- | ||
28 | configure.ac | 1 + | ||
29 | include/lapi/pidfd.h | 3 +++ | ||
30 | 2 files changed, 4 insertions(+) | ||
31 | |||
32 | diff --git a/configure.ac b/configure.ac | ||
33 | index 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 \ | ||
44 | diff --git a/include/lapi/pidfd.h b/include/lapi/pidfd.h | ||
45 | index 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 | -- | ||
59 | 2.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 | ||
43 | S = "${WORKDIR}/git" | 44 | S = "${WORKDIR}/git" |