fix compiling errors on fedora-rawhide
cover fix compiling errors on fedora-rawhide
CI job: https://github.com/wangli5665/ltp/runs/7686209513
Li Wang (2):
lapi/pidfd: adding pidfd header file lapi/fsmount: resolve conflict in different header files
configure.ac | 2 ++ include/lapi/fs.h | 6 ++++-- include/lapi/fsmount.h | 6 ++++-- include/lapi/pidfd.h | 3 +++ testcases/kernel/syscalls/fsconfig/fsconfig01.c | 1 + testcases/kernel/syscalls/fsconfig/fsconfig02.c | 1 + testcases/kernel/syscalls/fsmount/fsmount01.c | 1 + testcases/kernel/syscalls/fsmount/fsmount02.c | 1 + testcases/kernel/syscalls/fsopen/fsopen01.c | 1 + testcases/kernel/syscalls/fsopen/fsopen02.c | 1 + testcases/kernel/syscalls/fspick/fspick01.c | 1 + testcases/kernel/syscalls/fspick/fspick02.c | 1 + testcases/kernel/syscalls/mount_setattr/mount_setattr01.c | 1 + testcases/kernel/syscalls/move_mount/move_mount01.c | 1 + testcases/kernel/syscalls/move_mount/move_mount02.c | 1 + testcases/kernel/syscalls/open_tree/open_tree01.c | 1 + testcases/kernel/syscalls/open_tree/open_tree02.c | 1 + 17 files changed, 26 insertions(+), 4 deletions(-)
Signature · 5 lines
2.35.3 -- Mailing list info: https://lists.linux.it/listinfo/ltp
PATCH 1/2 lapi/pidfd: adding pidfd header file
The newer Glibc already provided wrapper for the series pidfd syscall, so let's include the header file conditionally.
# rpm -q glibc-devel glibc-devel-2.35.9000-31.fc37.ppc64le
# rpm -ql glibc-devel | grep pidfd /usr/include/sys/pidfd.h
To get rid of compiling error from fedora-rawhide:
tst_safe_macros.c: In function ‘safe_pidfd_open’:
tst_safe_macros.c:135:16: error: implicit declaration of function ‘pidfd_open’ [-Werror=implicit-function-declaration]
135 | rval = pidfd_open(pid, flags);
| ^~~~~~~~~~--- configure.ac | 1 + include/lapi/pidfd.h | 3 +++ 2 files changed, 4 insertions(+)
configure.ac +1 -0
@@ -71,6 +71,7 @@ AC_CHECK_HEADERS_ONCE([ \ sys/epoll.h \ sys/fanotify.h \ sys/inotify.h \ + sys/pidfd.h sys/prctl.h \ sys/shm.h \ sys/timerfd.h \
include/lapi/pidfd.h +3 -0
@@ -8,6 +8,9 @@#define LAPI_PIDFD_H__ #include <fcntl.h> +#ifdef HAVE_SYS_PIDFD_H +# include <sys/pidfd.h> +#endif #include "config.h" #include "lapi/syscalls.h"
Signature · 5 lines
2.35.3 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Re: [LTP] [PATCH 1/2] lapi/pidfd: adding pidfd header file
Hi Li,
obviously correct, thanks!
BTW if you wish to use rawhide in CI, we can give it a try (could be reverted to fedora:latest - i.e. the latest release if got problematic).
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Re: [LTP] [PATCH 1/2] lapi/pidfd: adding pidfd header file
Hi Petr,
Quoted 4 lines · Petr Vorel
Hi Li,
obviously correct, thanks!
Patchset merged.
Quoted 4 lines
BTW if you wish to use rawhide in CI, we can give it a try (could be reverted to fedora:latest - i.e. the latest release if got problematic).
Thanks, but I'm not very passionate about enabling it, as we now have ltp quick test on fedora-rawhide internally(RedHat), but obviously that consumed people's energy on debugging *temporally* failure[1]. I'm still thinking if that's worth it.
[1] some of them disappear after code-rebase or package upgrading
Signature · 2 lines
Regards, Li Wang
Signature · 2 lines
-- Mailing list info: https://lists.linux.it/listinfo/ltp
Re: [LTP] [PATCH 1/2] lapi/pidfd: adding pidfd header file
...
Quoted 4 lines
Thanks, but I'm not very passionate about enabling it, as we now have ltp quick test on fedora-rawhide internally(RedHat), but obviously that consumed people's energy on debugging *temporally* failure[1]. I'm still thinking if that's worth it.
Hi Li,
Sure, np.
Petr
Quoted 1 line
[1] some of them disappear after code-rebase or package upgrading
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
PATCH 2/2 lapi/fsmount: resolve conflict in different header files
In reply to Li WangThe latest glibc added new wrappers (e.g. mount_setattr, fsopen) support in sys/mount.h, which partly conflicts with linux/mount.h at the same time.
We need to make adjustments to header files to fix compiling error on different platforms.
--- configure.ac | 1 + include/lapi/fs.h | 6 ++++-- include/lapi/fsmount.h | 6 ++++-- testcases/kernel/syscalls/fsconfig/fsconfig01.c | 1 + testcases/kernel/syscalls/fsconfig/fsconfig02.c | 1 + testcases/kernel/syscalls/fsmount/fsmount01.c | 1 + testcases/kernel/syscalls/fsmount/fsmount02.c | 1 + testcases/kernel/syscalls/fsopen/fsopen01.c | 1 + testcases/kernel/syscalls/fsopen/fsopen02.c | 1 + testcases/kernel/syscalls/fspick/fspick01.c | 1 + testcases/kernel/syscalls/fspick/fspick02.c | 1 + testcases/kernel/syscalls/mount_setattr/mount_setattr01.c | 1 + testcases/kernel/syscalls/move_mount/move_mount01.c | 1 + testcases/kernel/syscalls/move_mount/move_mount02.c | 1 + testcases/kernel/syscalls/open_tree/open_tree01.c | 1 + testcases/kernel/syscalls/open_tree/open_tree02.c | 1 + 16 files changed, 22 insertions(+), 4 deletions(-)
configure.ac +1 -0
@@ -113,6 +113,7 @@ AC_CHECK_FUNCS_ONCE([ \ mkdirat \ mknodat \ modify_ldt \ + mount_setattr \ move_mount \ name_to_handle_at \ open_tree \
include/lapi/fs.h +4 -2
@@ -6,8 +6,10 @@* Email: [email protected] */ -#ifdef HAVE_LINUX_FS_H -# include <linux/fs.h> +#ifndef HAVE_MOUNT_SETATTR +# ifdef HAVE_LINUX_FS_H +# include <linux/fs.h> +# endif #endif #include <sys/user.h>
include/lapi/fsmount.h +4 -2
@@ -12,8 +12,10 @@#include <sys/syscall.h> #include <sys/types.h> -#ifdef HAVE_LINUX_MOUNT_H -# include <linux/mount.h> +#ifndef HAVE_FSOPEN +# ifdef HAVE_LINUX_MOUNT_H +# include <linux/mount.h> +# endif #endif #include "lapi/fcntl.h"
testcases/kernel/syscalls/fsconfig/fsconfig01.c +1 -0
@@ -5,6 +5,7 @@* Basic fsconfig() test which tries to configure and mount the filesystem as * well. */ +#include <sys/mount.h> #include "tst_test.h" #include "lapi/fsmount.h"
testcases/kernel/syscalls/fsconfig/fsconfig02.c +1 -0
@@ -4,6 +4,7 @@* * Basic fsconfig() failure tests. */ +#include <sys/mount.h> #include "tst_test.h" #include "lapi/fsmount.h"
testcases/kernel/syscalls/fsmount/fsmount01.c +1 -0
@@ -6,6 +6,7 @@* Basic fsmount() test. */ +#include <sys/mount.h> #include "tst_test.h" #include "lapi/fsmount.h"
testcases/kernel/syscalls/fsmount/fsmount02.c +1 -0
@@ -4,6 +4,7 @@* * Basic fsmount() failure tests. */ +#include <sys/mount.h> #include "tst_test.h" #include "lapi/fsmount.h"
testcases/kernel/syscalls/fsopen/fsopen01.c +1 -0
@@ -5,6 +5,7 @@* Basic fsopen() test which tries to configure and mount the filesystem as * well. */ +#include <sys/mount.h> #include "tst_test.h" #include "lapi/fsmount.h"
testcases/kernel/syscalls/fsopen/fsopen02.c +1 -0
@@ -4,6 +4,7 @@* * Basic fsopen() failure tests. */ +#include <sys/mount.h> #include "tst_test.h" #include "lapi/fsmount.h"
testcases/kernel/syscalls/fspick/fspick01.c +1 -0
@@ -4,6 +4,7 @@* * Basic fspick() test. */ +#include <sys/mount.h> #include "tst_test.h" #include "lapi/fsmount.h"
testcases/kernel/syscalls/fspick/fspick02.c +1 -0
@@ -4,6 +4,7 @@* * Basic fspick() failure tests. */ +#include <sys/mount.h> #include "tst_test.h" #include "lapi/fsmount.h"
testcases/kernel/syscalls/mount_setattr/mount_setattr01.c +1 -0
@@ -30,6 +30,7 @@#define _GNU_SOURCE#include <sys/statvfs.h> +#include <sys/mount.h> #include "tst_test.h" #include "lapi/fsmount.h" #include "lapi/stat.h"
testcases/kernel/syscalls/move_mount/move_mount01.c +1 -0
@@ -4,6 +4,7 @@* * Basic move_mount() test. */ +#include <sys/mount.h> #include "tst_test.h" #include "lapi/fsmount.h"
testcases/kernel/syscalls/move_mount/move_mount02.c +1 -0
@@ -4,6 +4,7 @@* * Basic move_mount() failure tests. */ +#include <sys/mount.h> #include "tst_test.h" #include "lapi/fsmount.h"
testcases/kernel/syscalls/open_tree/open_tree01.c +1 -0
@@ -4,6 +4,7 @@* * Basic open_tree() test. */ +#include <sys/mount.h> #include "tst_test.h" #include "lapi/fsmount.h"
testcases/kernel/syscalls/open_tree/open_tree02.c +1 -0
@@ -4,6 +4,7 @@* * Basic open_tree() failure tests. */ +#include <sys/mount.h> #include "tst_test.h" #include "lapi/fsmount.h"
Signature · 5 lines
2.35.3 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Re: [LTP] [PATCH 2/2] lapi/fsmount: resolve conflict in different header files
Hi Li,
Quoted 5 lines
The latest glibc added new wrappers (e.g.
mount_setattr, fsopen) support insys/mount.h, which partly conflicts withlinux/mount.hat the same time.We need to make adjustments to header files to fix compiling error on different platforms.
thanks for fixing this!
LGTM, with suggestion.
Quoted 3 lines
+#include <
sys/mount.h>
#include "tst_test.h"
#include "lapi/fsmount.h"
How about instead adding it to the tests to add it to lapi/fsmount.h ?
#include <sys/mount.h>
#ifndef HAVE_FSOPEN
# ifdef HAVE_LINUX_MOUNT_H # include <linux/mount.h> # endif
Works on rawhide
https://github.com/pevik/ltp/actions/runs/2802006779
and on the rest
https://github.com/pevik/ltp/actions/runs/2801968366
and my branch li/fix-compiling-errors.fixes
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Re: [LTP] [PATCH 2/2] lapi/fsmount: resolve conflict in different header files
Hi Petr,
Quoted 10 lines · Petr Vorel
Hi Li,
Quoted 1 line
The latest glibc added new wrappers (e.g.
mount_setattr, fsopen) supportin
Quoted 4 lines
sys/mount.h, which partly conflicts withlinux/mount.hat the same time.We need to make adjustments to header files to fix compiling error on different platforms.
thanks for fixing this!
Quoted 7 lines
Reviewed-by Petr Vorel <[email protected]>LGTM, with suggestion.
Quoted 3 lines
+#include <
sys/mount.h>
#include "tst_test.h"
#include "lapi/fsmount.h"How about instead adding it to the tests to add it to
lapi/fsmount.h?
It's weird, I was unable to compile successfully like this way yesterday. So finally go by one by one including the header.
But after doing make distclean it works now, I guess there is probably something messes up my source directory.
Anyway, thanks for your quick review, will merge soon.
Signature · 2 lines
Regards, Li Wang
Signature · 2 lines
-- Mailing list info: https://lists.linux.it/listinfo/ltp