On 7/22/26 15:35, Cédric Le Goater wrote:
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.
Add a #ifndef guard so the host definition takes precedence when
available. The local fallback is kept for older kernel headers
(pre-2.6.29) that lack FUTEX_CMD_MASK or define a mask without
FUTEX_CLOCK_REALTIME.
Signed-off-by: Cédric Le Goater <[email protected]>
---
linux-user/syscall_defs.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index
5799769f832fd953fe731a33ad7746113dff9957..e033c7db341622e825da6457b1539dd2682b711f
100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -2593,7 +2593,9 @@ struct target_drm_i915_getparam {
#define FUTEX_PRIVATE_FLAG 128
#define FUTEX_CLOCK_REALTIME 256
+#ifndef FUTEX_CMD_MASK
It would be nice to have /* since linux 2.6.29 */ here.
But I wonder - if we really should care about such old kernels?
Quite a few qemu-user internals require more recent host kernel.
I guess it wont even compile with 3.x kernel headers :)
(this is why a comment like this is useful).
Thanks,
/mjt