From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/qemu/files/, app-emulation/qemu/
Date: Wed, 3 Aug 2022 18:21:37 +0000 (UTC) [thread overview]
Message-ID: <1659550885.db2a2bbc7edbb87b7c179b8cc61bef689a5211c5.sam@gentoo> (raw)
commit: db2a2bbc7edbb87b7c179b8cc61bef689a5211c5
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 3 18:21:19 2022 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Aug 3 18:21:25 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=db2a2bbc
app-emulation/qemu: fix build w/ glibc 2.36
Closes: https://bugs.gentoo.org/863443
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../qemu/files/qemu-7.0.0-glibc-2.36.patch | 90 ++++++++++++++++++++++
app-emulation/qemu/qemu-7.0.0-r3.ebuild | 1 +
2 files changed, 91 insertions(+)
diff --git a/app-emulation/qemu/files/qemu-7.0.0-glibc-2.36.patch b/app-emulation/qemu/files/qemu-7.0.0-glibc-2.36.patch
new file mode 100644
index 000000000000..85343c4d00e7
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-7.0.0-glibc-2.36.patch
@@ -0,0 +1,90 @@
+https://lore.kernel.org/all/20220802183409.GB2040@redhat.com/T/
+https://bugs.gentoo.org/863443
+
+From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
+To: qemu-devel@nongnu.org
+Cc: Laurent Vivier <laurent@vivier.eu>,
+ =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
+Subject: [PATCH for 7.1] linux-user: fix compat with glibc >= 2.36 sys/mount.h
+Date: Tue, 2 Aug 2022 12:41:34 -0400
+
+The latest glibc 2.36 has extended sys/mount.h so that it
+defines the FSCONFIG_* enum constants. These are historically
+defined in linux/mount.h, and thus if you include both headers
+the compiler complains:
+
+In file included from /usr/include/linux/fs.h:19,
+ from ../linux-user/syscall.c:98:
+/usr/include/linux/mount.h:95:6: error: redeclaration of 'enum fsconfig_command'
+ 95 | enum fsconfig_command {
+ | ^~~~~~~~~~~~~~~~
+In file included from ../linux-user/syscall.c:31:
+/usr/include/sys/mount.h:189:6: note: originally defined here
+ 189 | enum fsconfig_command
+ | ^~~~~~~~~~~~~~~~
+/usr/include/linux/mount.h:96:9: error: redeclaration of enumerator 'FSCONFIG_SET_FLAG'
+ 96 | FSCONFIG_SET_FLAG = 0, /* Set parameter, supplying no value */
+ | ^~~~~~~~~~~~~~~~~
+/usr/include/sys/mount.h:191:3: note: previous definition of 'FSCONFIG_SET_FLAG' with type 'enum fsconfig_command'
+ 191 | FSCONFIG_SET_FLAG = 0, /* Set parameter, supplying no value */
+ | ^~~~~~~~~~~~~~~~~
+...snip...
+
+QEMU doesn't include linux/mount.h, but it does use
+linux/fs.h and thus gets linux/mount.h indirectly.
+
+glibc acknowledges this problem but does not appear to
+be intending to fix it in the forseeable future, simply
+documenting it as a known incompatibility with no
+workaround:
+
+ https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+ https://sourceware.org/glibc/wiki/Synchronizing_Headers
+
+To address this requires either removing use of sys/mount.h
+or linux/fs.h, despite QEMU needing declarations from
+both.
+
+This patch removes linux/fs.h, meaning we have to define
+various FS_IOC constants that are now unavailable.
+
+Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
+--- a/linux-user/syscall.c
++++ b/linux-user/syscall.c
+@@ -95,7 +95,25 @@
+ #include <linux/soundcard.h>
+ #include <linux/kd.h>
+ #include <linux/mtio.h>
++
++#ifdef HAVE_SYS_MOUNT_FSCONFIG
++/*
++ * glibc >= 2.36 linux/mount.h conflicts with sys/mount.h,
++ * which in turn prevents use of linux/fs.h. So we have to
++ * define the constants ourselves for now.
++ */
++#define FS_IOC_GETFLAGS _IOR('f', 1, long)
++#define FS_IOC_SETFLAGS _IOW('f', 2, long)
++#define FS_IOC_GETVERSION _IOR('v', 1, long)
++#define FS_IOC_SETVERSION _IOW('v', 2, long)
++#define FS_IOC_FIEMAP _IOWR('f', 11, struct fiemap)
++#define FS_IOC32_GETFLAGS _IOR('f', 1, int)
++#define FS_IOC32_SETFLAGS _IOW('f', 2, int)
++#define FS_IOC32_GETVERSION _IOR('v', 1, int)
++#define FS_IOC32_SETVERSION _IOW('v', 2, int)
++#else
+ #include <linux/fs.h>
++#endif
+ #include <linux/fd.h>
+ #if defined(CONFIG_FIEMAP)
+ #include <linux/fiemap.h>
+--- a/meson.build
++++ b/meson.build
+@@ -1963,6 +1963,8 @@ config_host_data.set('HAVE_OPTRESET',
+ cc.has_header_symbol('getopt.h', 'optreset'))
+ config_host_data.set('HAVE_IPPROTO_MPTCP',
+ cc.has_header_symbol('netinet/in.h', 'IPPROTO_MPTCP'))
++config_host_data.set('HAVE_SYS_MOUNT_FSCONFIG',
++ cc.has_header_symbol('sys/mount.h', 'FSCONFIG_SET_FLAG'))
+
+ # has_member
+ config_host_data.set('HAVE_SIGEV_NOTIFY_THREAD_ID',
diff --git a/app-emulation/qemu/qemu-7.0.0-r3.ebuild b/app-emulation/qemu/qemu-7.0.0-r3.ebuild
index d79b2ecdb29b..09762b74b160 100644
--- a/app-emulation/qemu/qemu-7.0.0-r3.ebuild
+++ b/app-emulation/qemu/qemu-7.0.0-r3.ebuild
@@ -300,6 +300,7 @@ PATCHES=(
"${FILESDIR}"/${PN}-7.0.0-also-build-virtfs-proxy-helper.patch
"${FILESDIR}"/${P}-virtio-scsi-fixes.patch
"${FILESDIR}"/${P}-pci-overflow-fortify-source-3.patch
+ "${FILESDIR}"/${P}-glibc-2.36.patch
)
QA_PREBUILT="
next reply other threads:[~2022-08-03 18:21 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-03 18:21 Sam James [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-10-12 6:33 [gentoo-commits] repo/gentoo:master commit in: app-emulation/qemu/files/, app-emulation/qemu/ Sam James
2025-05-07 18:41 Sam James
2025-02-26 6:31 Sam James
2025-02-20 17:17 Sam James
2024-04-29 2:38 Sam James
2023-07-02 23:35 Sam James
2023-07-02 23:01 Sam James
2023-05-18 21:07 Matthias Maier
2023-05-05 18:11 Matthias Maier
2023-02-21 6:50 Sam James
2023-02-04 16:46 Andreas K. Hüttel
2022-12-08 1:22 John Helmert III
2022-11-12 19:43 Andreas K. Hüttel
2022-09-27 17:31 John Helmert III
2022-07-05 1:05 WANG Xuerui
2022-06-04 3:01 Sam James
2022-05-22 15:59 John Helmert III
2022-03-29 5:38 Sam James
2022-01-01 1:22 John Helmert III
2021-12-21 23:53 John Helmert III
2021-06-26 19:59 Sergei Trofimovich
2021-04-12 19:39 Sergei Trofimovich
2021-02-28 23:24 Sergei Trofimovich
2020-12-12 23:53 Sergei Trofimovich
2020-12-12 8:33 Sergei Trofimovich
2020-12-10 15:03 Sergei Trofimovich
2020-10-21 20:55 Sergei Trofimovich
2020-09-08 7:33 Sergei Trofimovich
2020-04-24 19:59 Sergei Trofimovich
2020-04-16 22:16 Sergei Trofimovich
2019-05-21 3:53 Matthias Maier
2019-05-17 8:58 Matthias Maier
2019-05-17 7:43 Matthias Maier
2019-04-29 6:48 Matthias Maier
2019-02-19 0:19 Matthias Maier
2018-08-19 17:49 Matthias Maier
2018-06-15 14:10 Jason Donenfeld
2018-03-27 15:44 Matthias Maier
2018-03-18 20:02 Matthias Maier
2017-11-12 20:22 Matthias Maier
2017-07-26 17:15 Matthias Maier
2017-05-18 4:20 Matthias Maier
2017-04-25 13:51 Matthias Maier
2017-03-27 4:03 Matthias Maier
2017-02-13 4:58 Matthias Maier
2016-12-29 18:47 Mike Frysinger
2016-11-12 17:29 Matthias Maier
2016-09-27 2:17 Matthias Maier
2016-09-09 5:23 Matthias Maier
2016-09-05 16:45 Matthias Maier
2016-09-05 5:30 Matthias Maier
2016-08-07 14:04 Luca Barbato
2016-06-07 3:02 Mike Frysinger
2016-05-17 4:41 Mike Frysinger
2016-04-23 20:30 Mike Frysinger
2016-03-23 5:25 Mike Frysinger
2015-12-15 5:55 Mike Frysinger
2015-12-08 3:17 Mike Frysinger
2015-11-23 0:41 Mike Frysinger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1659550885.db2a2bbc7edbb87b7c179b8cc61bef689a5211c5.sam@gentoo \
--to=sam@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox