Skip to content

Commit c4c3fe4

Browse files
mati865kleisauke
authored and
gitbot
committed
control libunwind linkage mode via crt-static on gnullvm targets
Co-authored-by: Kleis Auke Wolthuizen <[email protected]>
1 parent 80765d8 commit c4c3fe4

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

unwind/src/lib.rs

+5
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,8 @@ cfg_if::cfg_if! {
178178
#[cfg(target_os = "hurd")]
179179
#[link(name = "gcc_s")]
180180
extern "C" {}
181+
182+
#[cfg(all(target_os = "windows", target_env = "gnu", target_abi = "llvm"))]
183+
#[link(name = "unwind", kind = "static", modifiers = "-bundle", cfg(target_feature = "crt-static"))]
184+
#[link(name = "unwind", cfg(not(target_feature = "crt-static")))]
185+
extern "C" {}

unwind/src/libunwind.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,9 @@ pub type _Unwind_Exception_Cleanup_Fn =
102102
// rustc_codegen_ssa::src::back::symbol_export, rustc_middle::middle::exported_symbols
103103
// and RFC 2841
104104
#[cfg_attr(
105-
any(
106-
all(
107-
feature = "llvm-libunwind",
108-
any(target_os = "fuchsia", target_os = "linux", target_os = "xous")
109-
),
110-
all(target_os = "windows", target_env = "gnu", target_abi = "llvm")
105+
all(
106+
feature = "llvm-libunwind",
107+
any(target_os = "fuchsia", target_os = "linux", target_os = "xous")
111108
),
112109
link(name = "unwind", kind = "static", modifiers = "-bundle")
113110
)]

0 commit comments

Comments
 (0)