From: Petr Vorel <pvorel@suse.cz>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: Fabrice Fontaine <fontaine.fabrice@gmail.com>, ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] configure.ac: fix mount_attr detection
Date: Thu, 9 Mar 2023 11:56:27 +0100 [thread overview]
Message-ID: <20230309105627.GA10008@pevik> (raw)
In-Reply-To: <Y/yTyk9rYYsPJyVA@yuki>
Hi all,
[ Cc Li - question from Cyril at the end ]
Fabrice, thanks for fixing this long standing issue.
> Hi!
> > Commit b857f8723f30a4b9554bf6b0ff8fa52fd07e8b60 tried to fix build with
> > latest glibc which provides mount_attr in sys/mount.h. Unfortunately,
> > the following build failure is still raised because sys/mount is now
> > unconditionally included in include/lapi/fsmount.h:
> > In file included from fsconfig01.c:9:
> > ../../../../include/lapi/fsmount.h:55:8: error: redefinition of 'struct mount_attr'
> > 55 | struct mount_attr {
> > | ^~~~~~~~~~
> > In file included from ../../../../include/lapi/fsmount.h:14:
> > /home/autobuild/autobuild/instance-4/output-1/host/armeb-buildroot-linux-gnueabi/sysroot/usr/include/sys/mount.h:210:8: note: originally defined here
> > 210 | struct mount_attr
> > | ^~~~~~~~~~
> > Fixes:
> > - http://autobuild.buildroot.org/results/4dbb72e1bf081afd3cd944571b9beeefc7608865
> > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> > ---
> > configure.ac | 6 +++---
> > 1 file changed, 3 insertions(+), 3 deletions(-)
> > diff --git a/configure.ac b/configure.ac
> > index c2b0f48e7..a6d8ac826 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -225,10 +225,10 @@ AC_CHECK_TYPES([struct __kernel_old_timeval, struct __kernel_old_timespec, struc
> > AC_CHECK_TYPES([struct futex_waitv],,,[#include <linux/futex.h>])
> > AC_CHECK_TYPES([struct mount_attr],,,[
> > -#ifdef HAVE_LINUX_MOUNT_H
> > -# include <linux/mount.h>
> > -#else
> > +#ifdef HAVE_MOUNT_SETATTR
> > # include <sys/mount.h>
> > +#elif HAVE_LINUX_MOUNT_H
> > +# include <linux/mount.h>
> > #endif
> > ])
> I wonder if we can get this whole mess of two different fallback headers
> simplified. Looking at the glibc implementation it seems to include
> "linux/mount.h" if it does exist. So most reasonable solution would do
> the same I guess which we did before the commit you reference.
> @Li Wang where does the the sys/mount.h and linux/mount.h conflict? As
> far as I can tell the UAPI linux/mount.h never defined any functions,
> just constants, which should be solvable without the complex ifdefs, we
> just need to check for existence of the types and define them only if
> missing.
Quoting [1]:
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);
|
=> Li, does the problem still persists? If yes, I'd be for merging this patch.
Could you also test it on newest glibc in Fedora?
Cyril, FYI musl never includes linux headers (Rich Felker has always been
against this practise).
Kind regards,
Petr
[1] https://lore.kernel.org/ltp/20220805063401.1647479-2-liwang@redhat.com/
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2023-03-09 10:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-26 19:25 [LTP] [PATCH] configure.ac: fix mount_attr detection Fabrice Fontaine
2023-02-27 11:28 ` Cyril Hrubis
2023-03-09 10:56 ` Petr Vorel [this message]
2023-03-09 13:09 ` Li Wang
2023-03-09 13:00 ` Li Wang
2023-03-10 6:25 ` Li Wang
2023-03-10 9:31 ` Petr Vorel
2023-03-10 9:42 ` Li Wang
2023-03-10 11:42 ` Petr Vorel
2023-03-20 14:59 ` Petr Vorel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230309105627.GA10008@pevik \
--to=pvorel@suse.cz \
--cc=chrubis@suse.cz \
--cc=fontaine.fabrice@gmail.com \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox