From c070d30e03eabac2f6108f21ac3321f29d0a711f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Miku=C5=82a?= Date: Sun, 6 Mar 2022 15:12:50 +0100 Subject: [PATCH] Add LLVM based mingw-w64 targets --- unwind/build.rs | 2 +- unwind/src/lib.rs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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" {}