Skip to content

Commit

Permalink
configure.ac: fix mount_attr detection
Browse files Browse the repository at this point in the history
Commit b857f87 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: b857f87 ("lapi/fsmount: resolve conflict in different header files")
Fixes: http://autobuild.buildroot.org/results/4dbb72e1bf081afd3cd944571b9beeefc7608865
Link: https://lore.kernel.org/ltp/20230226192554.669332-1-fontaine.fabrice@gmail.com/
Reviewed-by: Li Wang <liwang@redhat.com>
[ pvorel: fix from b857f87 is needed for glibc before glibc-2.37~426,
i.e. without fix 774058d729 ("linux: Fix sys/mount.h usage with kernel headers")
(which was backported to 2.35 and 2.34 maintenance). ]
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  • Loading branch information
ffontaine authored and pevik committed Mar 20, 2023
1 parent 357d821 commit 30353a1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,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
])

Expand Down

0 comments on commit 30353a1

Please sign in to comment.