From 7520ea9046de23d04829db40687a7fdde5034530 Mon Sep 17 00:00:00 2001 From: hyd-dev Date: Thu, 5 Aug 2021 17:42:27 +0800 Subject: [PATCH] Use `C-unwind` ABI for `__rust_start_panic` in `panic_abort` --- 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 d95ea6530c204..4580f9a7758f3 100644 --- a/library/panic_abort/src/lib.rs +++ b/library/panic_abort/src/lib.rs @@ -15,6 +15,7 @@ #![feature(staged_api)] #![feature(rustc_attrs)] #![feature(asm)] +#![feature(c_unwind)] #[cfg(target_os = "android")] mod android; @@ -30,7 +31,7 @@ pub unsafe extern "C" fn __rust_panic_cleanup(_: *mut u8) -> *mut (dyn Any + Sen // "Leak" the payload and shim to the relevant abort on the platform in question. #[rustc_std_internal_symbol] -pub unsafe extern "C" fn __rust_start_panic(_payload: *mut &mut dyn BoxMeUp) -> u32 { +pub unsafe extern "C-unwind" fn __rust_start_panic(_payload: *mut &mut dyn BoxMeUp) -> u32 { // Android has the ability to attach a message as part of the abort. #[cfg(target_os = "android")] android::android_set_abort_message(_payload);