2 #![unstable(feature = "panic_unwind", issue = "32837")]
4 #![feature(native_link_modifiers_bundle)]
6 #![feature(staged_api)]
8 #![cfg_attr(not(target_env = "msvc"), feature(libc))]
11 if #[cfg(target_env = "msvc")] {
12 // Windows MSVC no extra unwinder support needed
18 // These "unix" family members do not have unwinder.
19 // Note this also matches x86_64-unknown-none-linuxkernel.
24 target_os = "solid_asp3",
25 all(target_vendor = "fortanix", target_env = "sgx"),
30 // no unwinder on the system!
31 // - wasm32 (not emscripten, which is "unix" family)
32 // - os=none ("bare metal" targets)
36 // - nvptx64-nvidia-cuda
37 // - Any new targets not listed above.
41 #[cfg(target_env = "musl")]
43 if #[cfg(all(feature = "llvm-libunwind", feature = "system-llvm-libunwind"))] {
44 compile_error!("`llvm-libunwind` and `system-llvm-libunwind` cannot be enabled at the same time");
45 } else if #[cfg(feature = "llvm-libunwind")] {
46 #[link(name = "unwind", kind = "static", modifiers = "-bundle")]
48 } else if #[cfg(feature = "system-llvm-libunwind")] {
49 #[link(name = "unwind", kind = "static", modifiers = "-bundle", cfg(target_feature = "crt-static"))]
50 #[link(name = "unwind", cfg(not(target_feature = "crt-static")))]
53 #[link(name = "unwind", kind = "static", modifiers = "-bundle", cfg(target_feature = "crt-static"))]
54 #[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))]
59 // When building with crt-static, we get `gcc_eh` from the `libc` crate, since
60 // glibc needs it, and needs it listed later on the linker command line. We
61 // don't want to duplicate it here.
64 any(target_env = "gnu", target_env = "uclibc"),
65 not(feature = "llvm-libunwind"),
66 not(feature = "system-llvm-libunwind")
68 #[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))]
73 any(target_env = "gnu", target_env = "uclibc"),
74 not(feature = "llvm-libunwind"),
75 feature = "system-llvm-libunwind"
77 #[link(name = "unwind", cfg(not(target_feature = "crt-static")))]
80 #[cfg(target_os = "redox")]
81 #[link(name = "gcc_eh", kind = "static", modifiers = "-bundle", cfg(target_feature = "crt-static"))]
82 #[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))]
85 #[cfg(all(target_vendor = "fortanix", target_env = "sgx"))]
86 #[link(name = "unwind", kind = "static", modifiers = "-bundle")]