allow using the system-wide llvm-libunwind as the unwinder

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
This commit is contained in:
Marc-Antoine Perennou
2020-10-08 15:05:31 +02:00
parent f965120ad3
commit 66fa42a946
8 changed files with 58 additions and 9 deletions

View File

@@ -45,10 +45,24 @@ extern "C" {}
// When building with crt-static, we get `gcc_eh` from the `libc` crate, since
// glibc needs it, and needs it listed later on the linker command line. We
// don't want to duplicate it here.
#[cfg(all(target_os = "linux", target_env = "gnu", not(feature = "llvm-libunwind")))]
#[cfg(all(
target_os = "linux",
target_env = "gnu",
not(feature = "llvm-libunwind"),
not(feature = "system-llvm-libunwind")
))]
#[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))]
extern "C" {}
#[cfg(all(
target_os = "linux",
target_env = "gnu",
not(feature = "llvm-libunwind"),
feature = "system-llvm-libunwind"
))]
#[link(name = "unwind", cfg(not(target_feature = "crt-static")))]
extern "C" {}
#[cfg(target_os = "redox")]
#[link(name = "gcc_eh", kind = "static-nobundle", cfg(target_feature = "crt-static"))]
#[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))]