Skip to content

Commit 3b3f1e7

Browse files
authored
Fix build on FreeBSD/aarch64 (#12820)
1 parent 483eb43 commit 3b3f1e7

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

crates/wasmtime/src/runtime/vm/sys/unix/signals.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,13 @@ unsafe fn store_handler_in_ucontext(cx: *mut libc::c_void, handler: &Handler) {
383383
cx.uc_mcontext.mc_rsp = handler.sp as _;
384384
cx.uc_mcontext.mc_rax = 0;
385385
cx.uc_mcontext.mc_rdx = 0;
386+
} else if #[cfg(all(target_os = "freebsd", target_arch = "aarch64"))] {
387+
let cx = unsafe { cx.cast::<libc::mcontext_t>().as_mut().unwrap() };
388+
cx.mc_gpregs.gp_elr = handler.pc as _;
389+
cx.mc_gpregs.gp_sp = handler.sp as _;
390+
cx.mc_gpregs.gp_x[29] = handler.fp as _;
391+
cx.mc_gpregs.gp_x[0] = 0;
392+
cx.mc_gpregs.gp_x[1] = 0;
386393
} else if #[cfg(all(target_os = "openbsd", target_arch = "x86_64"))] {
387394
let cx = unsafe { cx.cast::<libc::ucontext_t>().as_mut().unwrap() };
388395
cx.sc_rip = handler.pc as _;

0 commit comments

Comments
 (0)