summaryrefslogtreecommitdiff
path: root/app-emulation/libvirt/files/libvirt-8.5.0-glibc-2.36.patch
blob: e02c5ea44086ad5ca088addf74dbabe671d06103 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
https://bugs.gentoo.org/863446
https://github.com/libvirt/libvirt/commit/9493c9b79dc541ec9e0fd73c6d87bdf8d30aaa90
https://github.com/libvirt/libvirt/commit/c0d9adf220dc0d223330a7bac37b174132d330ba

From 9493c9b79dc541ec9e0fd73c6d87bdf8d30aaa90 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Mon, 1 Aug 2022 15:20:38 -0400
Subject: [PATCH] lxc: containter: fix build with glibc 2.36

With glibc 2.36, sys/mount.h and linux/mount.h conflict:
https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E

lxc_container.c imports sys/mount.h and linux/fs.h, which pulls in
linux/mount.h.

linux/fs.h isn't required here though. glibc sys/mount.h has had
MS_MOVE since 2.12 in 2010

Reviewed-by: Erik Skultety <eskultet@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -33,9 +33,6 @@
 /* Yes, we want linux private one, for _syscall2() macro */
 #include <linux/unistd.h>
 
-/* For MS_MOVE */
-#include <linux/fs.h>
-
 #if WITH_CAPNG
 # include <cap-ng.h>
 #endif

From c0d9adf220dc0d223330a7bac37b174132d330ba Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Mon, 1 Aug 2022 15:24:01 -0400
Subject: [PATCH] virfile: Fix build with glibc 2.36

With glibc 2.36, sys/mount.h and linux/mount.h conflict:
https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E

virfile.c imports sys/mount.h and linux/fs.h, which pulls in
linux/mount.h.

Manually define the constants we need from linux/fs.h, like was
done in llvm:

https://reviews.llvm.org/rGb379129c4beb3f26223288627a1291739f33af02

Reviewed-by: Erik Skultety <eskultet@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -71,7 +71,11 @@
 # endif
 # include <sys/ioctl.h>
 # include <linux/cdrom.h>
-# include <linux/fs.h>
+/* These come from linux/fs.h, but that header conflicts with
+ * sys/mount.h on glibc 2.36+ */
+# define FS_IOC_GETFLAGS _IOR('f', 1, long)
+# define FS_IOC_SETFLAGS _IOW('f', 2, long)
+# define FS_NOCOW_FL 0x00800000
 #endif
 
 #if WITH_LIBATTR