From f4db1226c849091db5b71a25c34fc8d969407334 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Mon, 7 Nov 2022 19:04:47 +0800 Subject: [PATCH] panic_abort: call __rust_abort on xous Xous does not properly handle invalid instructions. Instead, call `__rust_abort` and exit normally. Signed-off-by: Sean Cross --- library/panic_abort/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/panic_abort/src/lib.rs b/library/panic_abort/src/lib.rs index cba8ef25db626..d3ac19f71c1cd 100644 --- a/library/panic_abort/src/lib.rs +++ b/library/panic_abort/src/lib.rs @@ -42,7 +42,8 @@ pub unsafe fn __rust_start_panic(_payload: *mut &mut dyn BoxMeUp) -> u32 { libc::abort(); } } else if #[cfg(any(target_os = "hermit", - all(target_vendor = "fortanix", target_env = "sgx") + all(target_vendor = "fortanix", target_env = "sgx"), + target_os = "xous" ))] { unsafe fn abort() -> ! { // call std::sys::abort_internal