Index | Thread | Search

From:
Brad Smith <brad@comstyle.com>
Subject:
Re: Fix emulators/qemu on riscv64
To:
Jeremie Courreges-Anglas <jca@wxcvbn.org>
Cc:
ports@openbsd.org
Date:
Fri, 19 Apr 2024 19:22:07 -0400

Download raw body.

Thread
OK.

On 2024-04-19 12:03 p.m., Jeremie Courreges-Anglas wrote:
> Use ucontext_t/struct sigcontext member name from machine/signal.h
> instead of Linux/glibc specific name.  Fixes the build on riscv64.
>
> ok?
>
>
> Index: patches/patch-tcg_riscv_tcg-target_c_inc
> ===================================================================
> RCS file: patches/patch-tcg_riscv_tcg-target_c_inc
> diff -N patches/patch-tcg_riscv_tcg-target_c_inc
> --- /dev/null	1 Jan 1970 00:00:00 -0000
> +++ patches/patch-tcg_riscv_tcg-target_c_inc	29 Feb 2024 12:38:25 -0000
> @@ -0,0 +1,12 @@
> +Index: tcg/riscv/tcg-target.c.inc
> +--- tcg/riscv/tcg-target.c.inc.orig
> ++++ tcg/riscv/tcg-target.c.inc
> +@@ -2115,7 +2115,7 @@ static void sigill_handler(int signo, siginfo_t *si, v
> + {
> +     /* Skip the faulty instruction */
> +     ucontext_t *uc = (ucontext_t *)data;
> +-    uc->uc_mcontext.__gregs[REG_PC] += 4;
> ++    uc->sc_sepc += 4;
> +
> +     got_sigill = 1;
> + }
>