Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 1 | Avoid conflicts between sys/mount.h and linux/mount.h that are seen |
| 2 | with glibc 2.36 |
| 3 | |
| 4 | Source: https://github.com/archlinux/svntogit-packages/blob/packages/qemu/trunk/qemu-7.0.0-glibc-2.36.patch |
| 5 | |
| 6 | Upstream-Status: Pending |
| 7 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 8 | --- a/linux-user/syscall.c |
| 9 | +++ b/linux-user/syscall.c |
| 10 | @@ -95,7 +95,25 @@ |
| 11 | #include <linux/soundcard.h> |
| 12 | #include <linux/kd.h> |
| 13 | #include <linux/mtio.h> |
| 14 | + |
| 15 | +#ifdef HAVE_SYS_MOUNT_FSCONFIG |
| 16 | +/* |
| 17 | + * glibc >= 2.36 linux/mount.h conflicts with sys/mount.h, |
| 18 | + * which in turn prevents use of linux/fs.h. So we have to |
| 19 | + * define the constants ourselves for now. |
| 20 | + */ |
| 21 | +#define FS_IOC_GETFLAGS _IOR('f', 1, long) |
| 22 | +#define FS_IOC_SETFLAGS _IOW('f', 2, long) |
| 23 | +#define FS_IOC_GETVERSION _IOR('v', 1, long) |
| 24 | +#define FS_IOC_SETVERSION _IOW('v', 2, long) |
| 25 | +#define FS_IOC_FIEMAP _IOWR('f', 11, struct fiemap) |
| 26 | +#define FS_IOC32_GETFLAGS _IOR('f', 1, int) |
| 27 | +#define FS_IOC32_SETFLAGS _IOW('f', 2, int) |
| 28 | +#define FS_IOC32_GETVERSION _IOR('v', 1, int) |
| 29 | +#define FS_IOC32_SETVERSION _IOW('v', 2, int) |
| 30 | +#else |
| 31 | #include <linux/fs.h> |
| 32 | +#endif |
| 33 | #include <linux/fd.h> |
| 34 | #if defined(CONFIG_FIEMAP) |
| 35 | #include <linux/fiemap.h> |
| 36 | --- a/meson.build |
| 37 | +++ b/meson.build |
| 38 | @@ -1686,6 +1686,8 @@ config_host_data.set('HAVE_OPTRESET', |
| 39 | cc.has_header_symbol('getopt.h', 'optreset')) |
| 40 | config_host_data.set('HAVE_IPPROTO_MPTCP', |
| 41 | cc.has_header_symbol('netinet/in.h', 'IPPROTO_MPTCP')) |
| 42 | +config_host_data.set('HAVE_SYS_MOUNT_FSCONFIG', |
| 43 | + cc.has_header_symbol('sys/mount.h', 'FSCONFIG_SET_FLAG')) |
| 44 | |
| 45 | # has_member |
| 46 | config_host_data.set('HAVE_SIGEV_NOTIFY_THREAD_ID', |