summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/qemu/qemu
diff options
context:
space:
mode:
authorJoel Stanley <joel@jms.id.au>2023-02-23 01:26:32 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-02-24 11:04:28 +0000
commiteb6b28bfe173d00db54b7001d60a7039ba29a450 (patch)
treefe6a69fc95816abb986e2c4d2e603f1fac1c8ab8 /meta/recipes-devtools/qemu/qemu
parent053b90804633ad186820c3f16b5f32edfcc66869 (diff)
downloadpoky-eb6b28bfe173d00db54b7001d60a7039ba29a450.tar.gz
qemu: Fix building with 6.2 kernel headers
When building native qemu with 6.2 kernel headers, qemu fails to build: In file included from /usr/include/linux/btrfs.h:29, from ../qemu-7.2.0/linux-user/syscall.c:165: /usr/include/linux/fs.h:50:8: error: redefinition of ‘struct file_clone_range’ 50 | struct file_clone_range { | ^~~~~~~~~~~~~~~~ ../qemu-7.2.0/linux-user/syscall.c:129:8: note: originally defined here 129 | struct file_clone_range { | ^~~~~~~~~~~~~~~~ Backport changes to linux-user that remove the local copy of struct file_clone_range. Patches from https://lore.kernel.org/qemu-devel/20230110174901.2580297-1-berrange@redhat.com/ (From OE-Core rev: 65b1e199dcaabf93bae33e06727bb1238b703d83) Signed-off-by: Joel Stanley <joel@jms.id.au> Tested-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/qemu/qemu')
-rw-r--r--meta/recipes-devtools/qemu/qemu/0001-Revert-linux-user-add-more-compat-ioctl-definitions.patch69
-rw-r--r--meta/recipes-devtools/qemu/qemu/0002-Revert-linux-user-fix-compat-with-glibc-2.36-sys-mou.patch78
2 files changed, 147 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu/0001-Revert-linux-user-add-more-compat-ioctl-definitions.patch b/meta/recipes-devtools/qemu/qemu/0001-Revert-linux-user-add-more-compat-ioctl-definitions.patch
new file mode 100644
index 0000000000..cd8121fed1
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/0001-Revert-linux-user-add-more-compat-ioctl-definitions.patch
@@ -0,0 +1,69 @@
1From afa96c55f2c270405de8984e2466067bbb44c0e4 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
3Date: Tue, 10 Jan 2023 12:49:00 -0500
4Subject: [PATCH] Revert "linux-user: add more compat ioctl definitions"
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9This reverts commit c5495f4ecb0cdaaf2e9dddeb48f1689cdb520ca0.
10
11glibc has fixed (in 2.36.9000-40-g774058d729) the problem
12that caused a clash when both sys/mount.h annd linux/mount.h
13are included, and backported this to the 2.36 stable release
14too:
15
16 https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
17
18It is saner for QEMU to remove the workaround it applied for
19glibc 2.36 and expect distros to ship the 2.36 maint release
20with the fix. This avoids needing to add a further workaround
21to QEMU to deal with the fact that linux/brtfs.h now also pulls
22in linux/mount.h via linux/fs.h since Linux 6.1
23
24Upstream-Status: Backport from v8.0 (master)
25
26Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
27Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
28Link: https://lore.kernel.org/r/20230110174901.2580297-2-berrange@redhat.com
29Signed-off-by: Joel Stanley <joel@jms.id.au>
30---
31 linux-user/syscall.c | 25 -------------------------
32 1 file changed, 25 deletions(-)
33
34diff --git a/linux-user/syscall.c b/linux-user/syscall.c
35index f95a6161e..510de8edc 100644
36--- a/linux-user/syscall.c
37+++ b/linux-user/syscall.c
38@@ -111,31 +111,6 @@
39 #define FS_IOC32_SETFLAGS _IOW('f', 2, int)
40 #define FS_IOC32_GETVERSION _IOR('v', 1, int)
41 #define FS_IOC32_SETVERSION _IOW('v', 2, int)
42-
43-#define BLKGETSIZE64 _IOR(0x12,114,size_t)
44-#define BLKDISCARD _IO(0x12,119)
45-#define BLKIOMIN _IO(0x12,120)
46-#define BLKIOOPT _IO(0x12,121)
47-#define BLKALIGNOFF _IO(0x12,122)
48-#define BLKPBSZGET _IO(0x12,123)
49-#define BLKDISCARDZEROES _IO(0x12,124)
50-#define BLKSECDISCARD _IO(0x12,125)
51-#define BLKROTATIONAL _IO(0x12,126)
52-#define BLKZEROOUT _IO(0x12,127)
53-
54-#define FIBMAP _IO(0x00,1)
55-#define FIGETBSZ _IO(0x00,2)
56-
57-struct file_clone_range {
58- __s64 src_fd;
59- __u64 src_offset;
60- __u64 src_length;
61- __u64 dest_offset;
62-};
63-
64-#define FICLONE _IOW(0x94, 9, int)
65-#define FICLONERANGE _IOW(0x94, 13, struct file_clone_range)
66-
67 #else
68 #include <linux/fs.h>
69 #endif
diff --git a/meta/recipes-devtools/qemu/qemu/0002-Revert-linux-user-fix-compat-with-glibc-2.36-sys-mou.patch b/meta/recipes-devtools/qemu/qemu/0002-Revert-linux-user-fix-compat-with-glibc-2.36-sys-mou.patch
new file mode 100644
index 0000000000..d754f21ad4
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/0002-Revert-linux-user-fix-compat-with-glibc-2.36-sys-mou.patch
@@ -0,0 +1,78 @@
1From e95c0a42940ca1cf763ca3374b36a9be030039d7 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
3Date: Tue, 10 Jan 2023 12:49:01 -0500
4Subject: [PATCH] Revert "linux-user: fix compat with glibc >= 2.36
5 sys/mount.h"
6MIME-Version: 1.0
7Content-Type: text/plain; charset=UTF-8
8Content-Transfer-Encoding: 8bit
9
10This reverts commit 3cd3df2a9584e6f753bb62a0028bd67124ab5532.
11
12glibc has fixed (in 2.36.9000-40-g774058d729) the problem
13that caused a clash when both sys/mount.h annd linux/mount.h
14are included, and backported this to the 2.36 stable release
15too:
16
17 https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
18
19It is saner for QEMU to remove the workaround it applied for
20glibc 2.36 and expect distros to ship the 2.36 maint release
21with the fix. This avoids needing to add a further workaround
22to QEMU to deal with the fact that linux/brtfs.h now also pulls
23in linux/mount.h via linux/fs.h since Linux 6.1
24
25Upstream-Status: Backport from v8.0 (master)
26
27Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
28Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
29Link: https://lore.kernel.org/r/20230110174901.2580297-3-berrange@redhat.com
30Signed-off-by: Joel Stanley <joel@jms.id.au>
31---
32 linux-user/syscall.c | 18 ------------------
33 meson.build | 2 --
34 2 files changed, 20 deletions(-)
35
36diff --git a/linux-user/syscall.c b/linux-user/syscall.c
37index 510de8edc..13a67b84b 100644
38--- a/linux-user/syscall.c
39+++ b/linux-user/syscall.c
40@@ -95,25 +95,7 @@
41 #include <linux/soundcard.h>
42 #include <linux/kd.h>
43 #include <linux/mtio.h>
44-
45-#ifdef HAVE_SYS_MOUNT_FSCONFIG
46-/*
47- * glibc >= 2.36 linux/mount.h conflicts with sys/mount.h,
48- * which in turn prevents use of linux/fs.h. So we have to
49- * define the constants ourselves for now.
50- */
51-#define FS_IOC_GETFLAGS _IOR('f', 1, long)
52-#define FS_IOC_SETFLAGS _IOW('f', 2, long)
53-#define FS_IOC_GETVERSION _IOR('v', 1, long)
54-#define FS_IOC_SETVERSION _IOW('v', 2, long)
55-#define FS_IOC_FIEMAP _IOWR('f', 11, struct fiemap)
56-#define FS_IOC32_GETFLAGS _IOR('f', 1, int)
57-#define FS_IOC32_SETFLAGS _IOW('f', 2, int)
58-#define FS_IOC32_GETVERSION _IOR('v', 1, int)
59-#define FS_IOC32_SETVERSION _IOW('v', 2, int)
60-#else
61 #include <linux/fs.h>
62-#endif
63 #include <linux/fd.h>
64 #if defined(CONFIG_FIEMAP)
65 #include <linux/fiemap.h>
66diff --git a/meson.build b/meson.build
67index e44432370..f37ba4114 100644
68--- a/meson.build
69+++ b/meson.build
70@@ -2032,8 +2032,6 @@ config_host_data.set('HAVE_OPTRESET',
71 cc.has_header_symbol('getopt.h', 'optreset'))
72 config_host_data.set('HAVE_IPPROTO_MPTCP',
73 cc.has_header_symbol('netinet/in.h', 'IPPROTO_MPTCP'))
74-config_host_data.set('HAVE_SYS_MOUNT_FSCONFIG',
75- cc.has_header_symbol('sys/mount.h', 'FSCONFIG_SET_FLAG'))
76
77 # has_member
78 config_host_data.set('HAVE_SIGEV_NOTIFY_THREAD_ID',