]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame_incremental - 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
... / ...
CommitLineData
1From c0d9adf220dc0d223330a7bac37b174132d330ba Mon Sep 17 00:00:00 2001
2From: Cole Robinson <crobinso@redhat.com>
3Date: Mon, 1 Aug 2022 15:24:01 -0400
4Subject: [PATCH] virfile: Fix build with glibc 2.36
5
6With glibc 2.36, sys/mount.h and linux/mount.h conflict:
7https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
8
9virfile.c imports sys/mount.h and linux/fs.h, which pulls in
10linux/mount.h.
11
12Manually define the constants we need from linux/fs.h, like was
13done in llvm:
14
15https://reviews.llvm.org/rGb379129c4beb3f26223288627a1291739f33af02
16
17Reviewed-by: Erik Skultety <eskultet@redhat.com>
18Signed-off-by: Cole Robinson <crobinso@redhat.com>
19---
20 src/util/virfile.c | 6 +++++-
21 1 file changed, 5 insertions(+), 1 deletion(-)
22
23diff --git a/src/util/virfile.c b/src/util/virfile.c
24index 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--
41GitLab
42