forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qemu-2.5.1-xfs-linux-headers.patch
82 lines (74 loc) · 2.57 KB
/
qemu-2.5.1-xfs-linux-headers.patch
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
https://bugs.gentoo.org/577810
From 277abf15a60f7653bfb05ffb513ed74ffdaea1b7 Mon Sep 17 00:00:00 2001
From: Jan Vesely <[email protected]>
Date: Fri, 29 Apr 2016 13:15:23 -0400
Subject: [PATCH] configure: Check if struct fsxattr is available from linux
header
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fixes build failure with --enable-xfsctl and
new linux headers (>=4.5) and older xfsprogs(<4.5):
In file included from /usr/include/xfs/xfs.h:38:0,
from /var/tmp/portage/app-emulation/qemu-2.5.0-r1/work/qemu-2.5.0/block/raw-posix.c:97:
/usr/include/xfs/xfs_fs.h:42:8: error: redefinition of ‘struct fsxattr’
struct fsxattr {
^
In file included from /var/tmp/portage/app-emulation/qemu-2.5.0-r1/work/qemu-2.5.0/block/raw-posix.c:60:0:
/usr/include/linux/fs.h:155:8: note: originally defined here
struct fsxattr {
This is really a bug in the system headers, but we can work around it
by defining HAVE_FSXATTR in the QEMU headers if linux/fs.h provides
the struct, so that xfs_fs.h doesn't try to define it as well.
CC: Markus Armbruster <[email protected]>
CC: Peter Maydell <[email protected]>
CC: Stefan Weil <[email protected]>
Tested-by: Stefan Weil <[email protected]>
Signed-off-by: Jan Vesely <[email protected]>
[PMM: adjusted commit message, comments]
Signed-off-by: Peter Maydell <[email protected]>
---
configure | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/configure b/configure
index ab54f3c..c37fc5f 100755
--- a/configure
+++ b/configure
@@ -4494,6 +4494,21 @@ if test "$fortify_source" != "no"; then
fi
##########################################
+# check if struct fsxattr is available via linux/fs.h
+
+have_fsxattr=no
+cat > $TMPC << EOF
+#include <linux/fs.h>
+struct fsxattr foo;
+int main(void) {
+ return 0;
+}
+EOF
+if compile_prog "" "" ; then
+ have_fsxattr=yes
+fi
+
+##########################################
# End of CC checks
# After here, no more $cc or $ld runs
@@ -5160,6 +5175,14 @@ fi
if test "$have_ifaddrs_h" = "yes" ; then
echo "HAVE_IFADDRS_H=y" >> $config_host_mak
fi
+
+# Work around a system header bug with some kernel/XFS header
+# versions where they both try to define 'struct fsxattr':
+# xfs headers will not try to redefine structs from linux headers
+# if this macro is set.
+if test "$have_fsxattr" = "yes" ; then
+ echo "HAVE_FSXATTR=y" >> $config_host_mak
+fi
if test "$vte" = "yes" ; then
echo "CONFIG_VTE=y" >> $config_host_mak
echo "VTE_CFLAGS=$vte_cflags" >> $config_host_mak
--
2.8.2