2 #![unstable(feature = "panic_unwind", issue = "32837")]
4 #![feature(staged_api)]
6 #![feature(cfg_target_abi)]
7 #![cfg_attr(not(target_env = "msvc"), feature(libc))]
10 if #[cfg(target_env = "msvc")] {
11 // Windows MSVC no extra unwinder support needed
17 // These "unix" family members do not have unwinder.
18 // Note this also matches x86_64-unknown-none-linuxkernel.
23 target_os = "solid_asp3",
24 all(target_vendor = "fortanix", target_env = "sgx"),
29 // no unwinder on the system!
30 // - wasm32 (not emscripten, which is "unix" family)
31 // - os=none ("bare metal" targets)
35 // - nvptx64-nvidia-cuda
36 // - Any new targets not listed above.
40 #[cfg(target_env = "musl")]
42 if #[cfg(all(feature = "llvm-libunwind", feature = "system-llvm-libunwind"))] {
43 compile_error!("`llvm-libunwind` and `system-llvm-libunwind` cannot be enabled at the same time");
44 } else if #[cfg(feature = "llvm-libunwind")] {
45 #[link(name = "unwind", kind = "static", modifiers = "-bundle")]
47 } else if #[cfg(feature = "system-llvm-libunwind")] {
48 #[link(name = "unwind", kind = "static", modifiers = "-bundle", cfg(target_feature = "crt-static"))]
49 #[link(name = "unwind", cfg(not(target_feature = "crt-static")))]
52 #[link(name = "unwind", kind = "static", modifiers = "-bundle", cfg(target_feature = "crt-static"))]
53 #[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))]
58 // When building with crt-static, we get `gcc_eh` from the `libc` crate, since
59 // glibc needs it, and needs it listed later on the linker command line. We
60 // don't want to duplicate it here.
63 any(target_env = "gnu", target_env = "uclibc"),
64 not(feature = "llvm-libunwind"),
65 not(feature = "system-llvm-libunwind")
67 #[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))]
72 any(target_env = "gnu", target_env = "uclibc"),
73 not(feature = "llvm-libunwind"),
74 feature = "system-llvm-libunwind"
76 #[link(name = "unwind", cfg(not(target_feature = "crt-static")))]
79 #[cfg(target_os = "redox")]
80 #[link(name = "gcc_eh", kind = "static", modifiers = "-bundle", cfg(target_feature = "crt-static"))]
81 #[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))]
84 #[cfg(all(target_vendor = "fortanix", target_env = "sgx"))]
85 #[link(name = "unwind", kind = "static", modifiers = "-bundle")]
88 #[cfg(all(target_os = "windows", target_env = "gnu", target_abi = "llvm"))]
89 #[link(name = "unwind", kind = "static", modifiers = "-bundle")]