Wrong unpacked structure for epoll_event on qemu-or1k (openrisc)
Host environment
- Operating system: Slackware GNU/Linux
- OS/kernel version: Linux ryzen 6.1.14 #1 SMP PREEMPT_DYNAMIC Sat Feb 25 13:52:36 CST 2023 x86_64 AMD Ryzen 7 3700X 8-Core Processor AuthenticAMD GNU/Linux
- Architecture: x86_64
- QEMU flavor: qemu-or1k (user)
- QEMU version: 8.0.50 (git commit hash 4633c1e2)
Emulated/Virtualized environment
- Operating system: GNU/Linux OpenRISC user-space
- Architecture: or1k (OpenRISC)
Description of problem
When using cmake automoc, the process will infinite loop waiting for epoll_events.
Steps to reproduce
- Try to compile cmake with qt5 support
- The build process will freeze when "Automatic MOC" is invoked
Additional information
The problem is that or1k has a "packed" epoll_event structure, so it should be also packed in target_epoll_event structure. Following the (very trivial) patch:
--- qemu-20230327/linux-user/syscall_defs.h.orig 2023-03-27 15:41:42.000000000 +0200
+++ qemu-20230327/linux-user/syscall_defs.h 2023-06-30 17:29:39.034322213 +0200
@@ -2714,7 +2709,7 @@
#define FUTEX_CMD_MASK ~(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME)
#ifdef CONFIG_EPOLL
-#if defined(TARGET_X86_64)
+#if defined(TARGET_X86_64) || defined(TARGET_OPENRISC)
#define TARGET_EPOLL_PACKED QEMU_PACKED
#else
#define TARGET_EPOLL_PACKED
Edited by Luca Bonissi