From 68c59397221423311046eaff461a7d52e4399bce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Miku=C5=82a?= Date: Tue, 1 Nov 2022 12:22:30 +0100 Subject: [PATCH] Change the way libunwind is linked for `*-windows-gnullvm` targets --- library/unwind/src/lib.rs | 4 ---- library/unwind/src/libunwind.rs | 5 ++++- src/bootstrap/compile.rs | 1 - 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/library/unwind/src/lib.rs b/library/unwind/src/lib.rs index 46fe50cb9453..25c990d8f76c 100644 --- a/library/unwind/src/lib.rs +++ b/library/unwind/src/lib.rs @@ -104,7 +104,3 @@ 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" {} diff --git a/library/unwind/src/libunwind.rs b/library/unwind/src/libunwind.rs index a5b6193b086f..e4bdd986f0b1 100644 --- a/library/unwind/src/libunwind.rs +++ b/library/unwind/src/libunwind.rs @@ -90,7 +90,10 @@ pub type _Unwind_Exception_Cleanup_Fn = // rustc_codegen_ssa::src::back::symbol_export, rustc_middle::middle::exported_symbols // and RFC 2841 #[cfg_attr( - all(feature = "llvm-libunwind", any(target_os = "fuchsia", target_os = "linux")), + any( + all(feature = "llvm-libunwind", any(target_os = "fuchsia", target_os = "linux")), + all(target_os = "windows", target_env = "gnu", target_abi = "llvm") + ), link(name = "unwind", kind = "static", modifiers = "-bundle") )] extern "C-unwind" { diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index e02a10b81640..19dfe9c80591 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -206,7 +206,6 @@ fn copy_third_party_objects( } if target == "x86_64-fortanix-unknown-sgx" - || target.contains("pc-windows-gnullvm") || builder.config.llvm_libunwind(target) == LlvmLibunwind::InTree && (target.contains("linux") || target.contains("fuchsia")) {