]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/libvirt-7.10.0-fix-glibc-headers.patch
libvirt: Fix build against glibc 2.36
[people/pmueller/ipfire-2.x.git] / src / patches / libvirt-7.10.0-fix-glibc-headers.patch
1 From c0d9adf220dc0d223330a7bac37b174132d330ba Mon Sep 17 00:00:00 2001
2 From: Cole Robinson <crobinso@redhat.com>
3 Date: Mon, 1 Aug 2022 15:24:01 -0400
4 Subject: [PATCH] virfile: Fix build with glibc 2.36
5
6 With glibc 2.36, sys/mount.h and linux/mount.h conflict:
7 https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
8
9 virfile.c imports sys/mount.h and linux/fs.h, which pulls in
10 linux/mount.h.
11
12 Manually define the constants we need from linux/fs.h, like was
13 done in llvm:
14
15 https://reviews.llvm.org/rGb379129c4beb3f26223288627a1291739f33af02
16
17 Reviewed-by: Erik Skultety <eskultet@redhat.com>
18 Signed-off-by: Cole Robinson <crobinso@redhat.com>
19 ---
20 src/util/virfile.c | 6 +++++-
21 1 file changed, 5 insertions(+), 1 deletion(-)
22
23 diff --git a/src/util/virfile.c b/src/util/virfile.c
24 index 99da058db3..ce541b8946 100644
25 --- a/src/util/virfile.c
26 +++ b/src/util/virfile.c
27 @@ -71,7 +71,11 @@
28 # endif
29 # include <sys/ioctl.h>
30 # include <linux/cdrom.h>
31 -# include <linux/fs.h>
32 +/* These come from linux/fs.h, but that header conflicts with
33 + * sys/mount.h on glibc 2.36+ */
34 +# define FS_IOC_GETFLAGS _IOR('f', 1, long)
35 +# define FS_IOC_SETFLAGS _IOW('f', 2, long)
36 +# define FS_NOCOW_FL 0x00800000
37 #endif
38
39 #if WITH_LIBATTR
40 --
41 GitLab
42