diff options
author | Amanieu d'Antras <amanieu@gmail.com> | 2022-02-09 14:11:51 +0000 |
---|---|---|
committer | Amanieu d'Antras <amanieu@gmail.com> | 2022-08-23 16:12:58 +0800 |
commit | 5ff087669438ec406fd3abc99bd1b85b6fbe156a (patch) | |
tree | d273383af8014904fa5681e65f6c43af26ca4409 /library/panic_abort | |
parent | db94dbc597ac91cd5d16e898fa9081c09c879123 (diff) |
Move personality functions to std
These were previously in the panic_unwind crate with dummy stubs in the
panic_abort crate. However it turns out that this is insufficient: we
still need a proper personality function even with -C panic=abort to
handle the following cases:
1) `extern "C-unwind"` still needs to catch foreign exceptions with -C
panic=abort to turn them into aborts. This requires landing pads and a
personality function.
2) ARM EHABI uses the personality function when creating backtraces.
The dummy personality function in panic_abort was causing backtrace
generation to get stuck in a loop since the personality function is
responsible for advancing the unwind state to the next frame.
Diffstat (limited to 'library/panic_abort')
-rw-r--r-- | library/panic_abort/src/lib.rs | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/library/panic_abort/src/lib.rs b/library/panic_abort/src/lib.rs index 8801c670bc9..9a7ed246962 100644 --- a/library/panic_abort/src/lib.rs +++ b/library/panic_abort/src/lib.rs @@ -113,26 +113,6 @@ pub unsafe fn __rust_start_panic(_payload: *mut &mut dyn BoxMeUp) -> u32 { // binaries, but it should never be called as we don't link in an unwinding // runtime at all. pub mod personalities { - #[rustc_std_internal_symbol] - #[cfg(not(any( - all(target_family = "wasm", not(target_os = "emscripten")), - all(target_os = "windows", target_env = "gnu", target_arch = "x86_64",), - )))] - pub extern "C" fn rust_eh_personality() {} - - // On x86_64-pc-windows-gnu we use our own personality function that needs - // to return `ExceptionContinueSearch` as we're passing on all our frames. - #[rustc_std_internal_symbol] - #[cfg(all(target_os = "windows", target_env = "gnu", target_arch = "x86_64"))] - pub extern "C" fn rust_eh_personality( - _record: usize, - _frame: usize, - _context: usize, - _dispatcher: usize, - ) -> u32 { - 1 // `ExceptionContinueSearch` - } - // Similar to above, this corresponds to the `eh_catch_typeinfo` lang item // that's only used on Emscripten currently. // |