linux-user: Remove local FUTEX_CMD_MASK definition
PATCH 1/1 linux-user: Remove local FUTEX_CMD_MASK definition
Building linux-user on a host with Linux 7.2 kernel headers fails with a macro redefinition error for FUTEX_CMD_MASK. The kernel commit 3ca9595d9fb6 ("futex: Add support for unlocking robust futexes") expanded the mask to include the new FUTEX_ROBUST_UNLOCK and FUTEX_ROBUST_LIST32 flags, which conflicts with QEMU's local definition.
Since the host FUTEX_CMD_MASK is always available, remove the local copy.
--- linux-user/syscall_defs.h | 1 - 1 file changed, 1 deletion(-)
linux-user/syscall_defs.h +0 -1
@@ -2593,7 +2593,6 @@ struct target_drm_i915_getparam {#define FUTEX_PRIVATE_FLAG 128#define FUTEX_CLOCK_REALTIME 256 -#define FUTEX_CMD_MASK ~(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME)#if defined(TARGET_X86_64 )#define TARGET_EPOLL_PACKED QEMU_PACKED
Signature · 1 line
2.55.0
Quoted 20 lines · Cédric Le Goater
Building linux-user on a host with Linux 7.2 kernel headers fails with a macro redefinition error for
FUTEX_CMD_MASK. The kernel commit3ca9595d9fb6("futex: Add support for unlocking robust futexes") expanded the mask to include the newFUTEX_ROBUST_UNLOCKandFUTEX_ROBUST_LIST32flags, which conflicts with QEMU's local definition.Since the host
FUTEX_CMD_MASKis always available, remove the local copy.Signed-off-by Cédric Le Goater <[email protected]>--- linux-user/syscall_defs.h | 1 - 1 file changed, 1 deletion(-)linux-user/syscall_defs.h +0
-0
linux-user/syscall_defs.h struct target_drm_i915_getparam { · line 2596
Quoted 4 lines
linux-user/syscall_defs.h +0
-1@@ -2593,7 +2593,6 @@ struct target_drm_i915_getparam {#define FUTEX_PRIVATE_FLAG 128#define FUTEX_CLOCK_REALTIME 256 -#define FUTEX_CMD_MASK ~(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME)
To build with older kernel, I think we need to have:
#ifndef FUTEX_CMD_MASK
#define FUTEX_CMD_MASK ~(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME)
#endif
Thanks,
Laurent
Quoted 3 lines
linux-user/syscall_defs.h +0
-0#if defined(TARGET_X86_64 )#define TARGET_EPOLL_PACKED QEMU_PACKED