From b20d8d3396faadd76f413d1d073be5c7576e5780 Mon Sep 17 00:00:00 2001 From: Mateusz MikuĊ‚a Date: Mon, 28 Oct 2019 21:43:37 +0100 Subject: Statically link libstdc++ on windows-gnu --- src/bootstrap/compile.rs | 4 ++-- src/bootstrap/dist.rs | 2 +- src/bootstrap/native.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/bootstrap') diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index da8d43ed49b..8e5fe2520ca 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -657,11 +657,11 @@ pub fn build_codegen_backend(builder: &Builder<'_>, if let Some(ref s) = builder.config.llvm_ldflags { cargo.env("LLVM_LINKER_FLAGS", s); } - // Building with a static libstdc++ is only supported on linux right now, + // Building with a static libstdc++ is only supported on linux and mingw right now, // not for MSVC or macOS if builder.config.llvm_static_stdcpp && !target.contains("freebsd") && - !target.contains("windows") && + !target.contains("msvc") && !target.contains("apple") { let file = compiler_file(builder, builder.cxx(target).unwrap(), diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs index 93143570b0f..67907bc8cbf 100644 --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs @@ -236,7 +236,7 @@ fn make_win_dist( } let target_tools = ["gcc.exe", "ld.exe", "dlltool.exe", "libwinpthread-1.dll"]; - let mut rustc_dlls = vec!["libstdc++-6.dll", "libwinpthread-1.dll"]; + let mut rustc_dlls = vec!["libwinpthread-1.dll"]; if target_triple.starts_with("i686-") { rustc_dlls.push("libgcc_s_dw2-1.dll"); } else { diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index e76604e45bd..2e89fd5398d 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs @@ -159,7 +159,7 @@ impl Step for Llvm { // For distribution we want the LLVM tools to be *statically* linked to libstdc++ if builder.config.llvm_tools_enabled || builder.config.lldb_enabled { - if !target.contains("windows") { + if !target.contains("msvc") { if target.contains("apple") { cfg.define("CMAKE_EXE_LINKER_FLAGS", "-static-libstdc++"); } else { @@ -395,7 +395,7 @@ fn configure_cmake(builder: &Builder<'_>, cfg.define("CMAKE_C_FLAGS", cflags); let mut cxxflags = builder.cflags(target, GitRepo::Llvm).join(" "); if builder.config.llvm_static_stdcpp && - !target.contains("windows") && + !target.contains("msvc") && !target.contains("netbsd") { cxxflags.push_str(" -static-libstdc++"); -- cgit 1.4.1-3-g733a5