Skip to content

Commit 7c2fc62

Browse files
committed
libgcc_eh may depend on libpthread.
Make sure we link to the static libpthread, so that compiled Rust binaries do not depend on winpthread1.dll.
1 parent 78c3a49 commit 7c2fc62

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/libunwind/build.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ fn main() {
3535
} else if target.contains("dragonfly") {
3636
println!("cargo:rustc-link-lib=gcc_pic");
3737
} else if target.contains("windows-gnu") {
38-
println!("cargo:rustc-link-lib=gcc_eh");
38+
println!("cargo:rustc-link-lib=static-nobundle=gcc_eh");
39+
println!("cargo:rustc-link-lib=static-nobundle=pthread");
3940
} else if target.contains("fuchsia") {
4041
println!("cargo:rustc-link-lib=unwind");
4142
}

src/libunwind/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#![feature(cfg_target_vendor)]
1818
#![feature(staged_api)]
1919
#![feature(unwind_attributes)]
20+
#![feature(static_nobundle)]
2021

2122
#![cfg_attr(not(target_env = "msvc"), feature(libc))]
2223

0 commit comments

Comments
 (0)