2 #![unstable(feature = "panic_unwind", issue = "32837")]
4 #![feature(native_link_modifiers)]
5 #![feature(native_link_modifiers_bundle)]
7 #![feature(staged_api)]
8 #![feature(static_nobundle)]
10 #![cfg_attr(not(target_env = "msvc"), feature(libc))]
13 if #[cfg(target_env = "msvc")] {
14 // Windows MSVC no extra unwinder support needed
20 // These "unix" family members do not have unwinder.
21 // Note this also matches x86_64-unknown-none-linuxkernel.
26 all(target_vendor = "fortanix", target_env = "sgx"),
31 // no unwinder on the system!
32 // - wasm32 (not emscripten, which is "unix" family)
33 // - os=none ("bare metal" targets)
37 // - nvptx64-nvidia-cuda
38 // - Any new targets not listed above.
42 #[cfg(target_env = "musl")]
44 if #[cfg(all(feature = "llvm-libunwind", feature = "system-llvm-libunwind"))] {
45 compile_error!("`llvm-libunwind` and `system-llvm-libunwind` cannot be enabled at the same time");
46 } else if #[cfg(feature = "llvm-libunwind")] {
47 #[link(name = "unwind", kind = "static", modifiers = "-bundle")]
49 } else if #[cfg(feature = "system-llvm-libunwind")] {
50 #[link(name = "unwind", kind = "static", modifiers = "-bundle", cfg(target_feature = "crt-static"))]
51 #[link(name = "unwind", cfg(not(target_feature = "crt-static")))]
54 #[link(name = "unwind", kind = "static", modifiers = "-bundle", cfg(target_feature = "crt-static"))]
55 #[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))]
60 // When building with crt-static, we get `gcc_eh` from the `libc` crate, since
61 // glibc needs it, and needs it listed later on the linker command line. We
62 // don't want to duplicate it here.
66 not(feature = "llvm-libunwind"),
67 not(feature = "system-llvm-libunwind")
69 #[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))]
75 not(feature = "llvm-libunwind"),
76 feature = "system-llvm-libunwind"
78 #[link(name = "unwind", cfg(not(target_feature = "crt-static")))]
81 #[cfg(target_os = "redox")]
82 #[link(name = "gcc_eh", kind = "static", modifiers = "-bundle", cfg(target_feature = "crt-static"))]
83 #[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))]
86 #[cfg(all(target_vendor = "fortanix", target_env = "sgx"))]
87 #[link(name = "unwind", kind = "static", modifiers = "-bundle")]