void-packages/srcpkgs/qemu/patches/musl-ppc64-pt_regs.patch
q66 bd05206403 qemu: add patches to fix build on ppc64(le)-musl
The musl headers are laid out differently, so it needs a couple
workarounds to get access to all the definitions.

This also fixes qemu-user-static.

[ci skip]

Closes: #11373 [via git-merge-pr]
2019-04-29 11:15:00 +02:00

16 lines
672 B
Diff

On musl, the regs field in uc_mcontext is void * so it is necessary to
cast it. The sys/user.h include is to get access to definition of pt_regs.
--- accel/tcg/user-exec.c
+++ accel/tcg/user-exec.c
@@ -285,9 +285,10 @@ int cpu_signal_handler(int host_signum, void *pinfo,
* From Wine
*/
#ifdef linux
+#include <sys/user.h>
/* All Registers access - only for local access */
#define REG_sig(reg_name, context) \
- ((context)->uc_mcontext.regs->reg_name)
+ (((struct pt_regs *)(context)->uc_mcontext.regs)->reg_name)
/* Gpr Registers access */
#define GPR_sig(reg_num, context) REG_sig(gpr[reg_num], context)
/* Program counter */