From 7c2fc62a47a9e7e6c71492d5b3752ab78cf0af0d Mon Sep 17 00:00:00 2001 From: Vadim Chugunov Date: Fri, 24 Mar 2017 11:01:45 -0700 Subject: [PATCH] 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. --- src/libunwind/build.rs | 3 ++- src/libunwind/lib.rs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libunwind/build.rs b/src/libunwind/build.rs index ed3d5212bf256..9b8099d55a024 100644 --- a/src/libunwind/build.rs +++ b/src/libunwind/build.rs @@ -35,7 +35,8 @@ fn main() { } else if target.contains("dragonfly") { println!("cargo:rustc-link-lib=gcc_pic"); } else if target.contains("windows-gnu") { - println!("cargo:rustc-link-lib=gcc_eh"); + println!("cargo:rustc-link-lib=static-nobundle=gcc_eh"); + println!("cargo:rustc-link-lib=static-nobundle=pthread"); } else if target.contains("fuchsia") { println!("cargo:rustc-link-lib=unwind"); } diff --git a/src/libunwind/lib.rs b/src/libunwind/lib.rs index 7fa2ce650fd6c..d4d52322adab0 100644 --- a/src/libunwind/lib.rs +++ b/src/libunwind/lib.rs @@ -17,6 +17,7 @@ #![feature(cfg_target_vendor)] #![feature(staged_api)] #![feature(unwind_attributes)] +#![feature(static_nobundle)] #![cfg_attr(not(target_env = "msvc"), feature(libc))]