diff --git a/unwind/build.rs b/unwind/build.rs index 61d3f45ca..f88e6a924 100644 --- a/unwind/build.rs +++ b/unwind/build.rs @@ -36,7 +36,7 @@ fn main() { println!("cargo:rustc-link-lib=gcc_s"); } else if target.contains("dragonfly") { println!("cargo:rustc-link-lib=gcc_pic"); - } else if target.contains("pc-windows-gnu") { + } else if target.ends_with("pc-windows-gnu") { // This is handled in the target spec with late_link_args_[static|dynamic] } else if target.contains("uwp-windows-gnu") { println!("cargo:rustc-link-lib=unwind"); diff --git a/unwind/src/lib.rs b/unwind/src/lib.rs index a01b56004..c92a7d310 100644 --- a/unwind/src/lib.rs +++ b/unwind/src/lib.rs @@ -5,6 +5,7 @@ #![feature(nll)] #![feature(staged_api)] #![feature(c_unwind)] +#![feature(cfg_target_abi)] #![cfg_attr(not(target_env = "msvc"), feature(libc))] cfg_if::cfg_if! { @@ -85,3 +86,7 @@ extern "C" {} #[cfg(all(target_vendor = "fortanix", target_env = "sgx"))] #[link(name = "unwind", kind = "static", modifiers = "-bundle")] extern "C" {} + +#[cfg(all(target_os = "windows", target_env = "gnu", target_abi = "llvm"))] +#[link(name = "unwind", kind = "static", modifiers = "-bundle")] +extern "C" {}