-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Expand file tree
/
Copy pathmod.rs
More file actions
40 lines (38 loc) · 1.33 KB
/
Copy pathmod.rs
File metadata and controls
40 lines (38 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! This module contains the implementation of the `eh_personality` lang item.
//!
//! The actual implementation is heavily dependent on the target since Rust
//! tries to use the native stack unwinding mechanism whenever possible.
//!
//! This personality function is still required with `-C panic=abort` because
//! it is used to catch foreign exceptions from `extern "C-unwind"` and turn
//! them into aborts.
//!
//! Additionally, ARM EHABI uses the personality function when generating
//! backtraces.
mod dwarf;
#[cfg(not(any(test, doctest)))]
cfg_if::cfg_if! {
if #[cfg(target_os = "emscripten")] {
mod emcc;
} else if #[cfg(any(
all(target_family = "windows", target_env = "gnu"),
target_os = "psp",
target_os = "xous",
target_os = "solid_asp3",
all(target_family = "unix", not(target_os = "espidf"), not(target_os = "l4re"), not(target_os = "nuttx")),
all(target_vendor = "fortanix", target_env = "sgx"),
))] {
mod gcc;
} else {
// Targets that have a pre-defined personality:
// - msvc
// - wasm (except for emscripten)
// Targets that don't support unwinding.
// - os=none ("bare metal" targets)
// - os=uefi
// - os=espidf
// - os=hermit
// - nvptx64-nvidia-cuda
// - arch=avr
}
}