]> git.lizzy.rs Git - rust.git/blob - library/unwind/src/lib.rs
Merge branch 'master' into feature/incorporate-tracing
[rust.git] / library / unwind / src / lib.rs
1 #![no_std]
2 #![unstable(feature = "panic_unwind", issue = "32837")]
3 #![feature(link_cfg)]
4 #![feature(nll)]
5 #![feature(staged_api)]
6 #![feature(unwind_attributes)]
7 #![feature(static_nobundle)]
8 #![cfg_attr(not(target_env = "msvc"), feature(libc))]
9
10 cfg_if::cfg_if! {
11     if #[cfg(target_env = "msvc")] {
12         // Windows MSVC no extra unwinder support needed
13     } else if #[cfg(any(
14         target_os = "l4re",
15         target_os = "none",
16     ))] {
17         // These "unix" family members do not have unwinder.
18         // Note this also matches x86_64-linux-kernel.
19     } else if #[cfg(any(
20         unix,
21         windows,
22         target_os = "psp",
23         target_os = "cloudabi",
24         all(target_vendor = "fortanix", target_env = "sgx"),
25     ))] {
26         mod libunwind;
27         pub use libunwind::*;
28     } else {
29         // no unwinder on the system!
30         // - wasm32 (not emscripten, which is "unix" family)
31         // - os=none ("bare metal" targets)
32         // - os=hermit
33         // - os=uefi
34         // - os=cuda
35         // - nvptx64-nvidia-cuda
36         // - Any new targets not listed above.
37     }
38 }
39
40 #[cfg(target_env = "musl")]
41 #[link(name = "unwind", kind = "static", cfg(target_feature = "crt-static"))]
42 #[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))]
43 extern "C" {}
44
45 #[cfg(target_os = "redox")]
46 #[link(name = "gcc_eh", kind = "static-nobundle", cfg(target_feature = "crt-static"))]
47 #[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))]
48 extern "C" {}
49
50 #[cfg(all(target_vendor = "fortanix", target_env = "sgx"))]
51 #[link(name = "unwind", kind = "static-nobundle")]
52 extern "C" {}