qemu-e2k/linux-user
Daniel P. Berrangé 3cd3df2a95 linux-user: fix compat with glibc >= 2.36 sys/mount.h
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>
Tested-by: Richard W.M. Jones <rjones@redhat.com>
Message-Id: <20220802164134.1851910-1-berrange@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2022-08-10 18:37:46 +02:00
..
aarch64 linux-user/aarch64: Implement PR_SME_GET_VL, PR_SME_SET_VL 2022-07-11 13:43:52 +01:00
alpha
arm semihosting: Return void from do_common_semihosting 2022-06-28 04:35:07 +05:30
cris
generic
hexagon
hppa linux-user/hppa: Fix segfaults on page zero 2022-07-25 10:42:11 +02:00
i386 misc: fix commonly doubled up words 2022-08-01 11:58:02 +02:00
include
loongarch64 target/loongarch: Update gdb_set_fpu() and gdb_get_fpu() 2022-08-05 10:02:40 -07:00
m68k target/m68k: Make semihosting system only 2022-06-28 10:13:22 +05:30
microblaze
mips
mips64
nios2
openrisc
ppc
riscv linux-user/riscv: Align signal frame to 16 bytes 2022-08-02 08:56:49 +10:00
s390x
sh4
sparc
x86_64
xtensa
cpu_loop-common.h
elfload.c linux-user/aarch64: Add SME related hwcap entries 2022-07-11 13:43:52 +01:00
errnos.c.inc
exit.c
fd-trans.c
fd-trans.h
flat.h
flatload.c linux-user/flatload.c: Fix setting of image_info::end_code 2022-07-28 19:17:24 +02:00
ioctls.h
linux_loop.h
linuxload.c
loader.h
main.c semihosting: Create qemu_semihosting_guestfd_init 2022-06-28 04:36:50 +05:30
meson.build
mmap.c linux-user: Do not treat madvise()'s advice as a bitmask 2022-07-29 15:08:24 +02:00
qemu.h
semihost.c semihosting: Remove qemu_semihosting_console_outs 2022-06-28 04:41:20 +05:30
signal-common.h
signal.c
socket.h
strace.c
strace.h
strace.list
syscall_defs.h linux-user: Add LoongArch syscall support 2022-07-04 11:08:57 +05:30
syscall_types.h
syscall.c linux-user: fix compat with glibc >= 2.36 sys/mount.h 2022-08-10 18:37:46 +02:00
target_flat.h
thunk.c
trace-events
trace.h
uaccess.c
uname.c
uname.h
user-internals.h linux-user: Add partial support for MADV_DONTNEED 2022-06-24 10:00:00 +02:00
user-mmap.h linux-user: Add partial support for MADV_DONTNEED 2022-06-24 10:00:00 +02:00
vm86.c