Skip to content

Commit 8944adc

Browse files
authored
Unrolled build for #141819
Rollup merge of #141819 - mati865:windows-gnullvm-host-fixes, r=jieyouxu Fixes for building windows-gnullvm hosts Split out from: #140772
2 parents 852f15c + 885184a commit 8944adc

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/bootstrap/src/core/build_steps/compile.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,20 +1409,22 @@ fn rustc_llvm_env(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetSelect
14091409
cargo.env("LLVM_LINKER_FLAGS", llvm_linker_flags);
14101410
}
14111411

1412-
// Building with a static libstdc++ is only supported on linux right now,
1412+
// Building with a static libstdc++ is only supported on Linux and windows-gnu* right now,
14131413
// not for MSVC or macOS
14141414
if builder.config.llvm_static_stdcpp
14151415
&& !target.contains("freebsd")
14161416
&& !target.is_msvc()
14171417
&& !target.contains("apple")
14181418
&& !target.contains("solaris")
14191419
{
1420+
let libstdcxx_name =
1421+
if target.contains("windows-gnullvm") { "libc++.a" } else { "libstdc++.a" };
14201422
let file = compiler_file(
14211423
builder,
14221424
&builder.cxx(target).unwrap(),
14231425
target,
14241426
CLang::Cxx,
1425-
"libstdc++.a",
1427+
libstdcxx_name,
14261428
);
14271429
cargo.env("LLVM_STATIC_STDCPP", file);
14281430
}

src/bootstrap/src/core/build_steps/llvm.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,8 @@ impl Step for Llvm {
285285
LlvmBuildStatus::ShouldBuild(m) => m,
286286
};
287287

288-
if builder.llvm_link_shared() && target.is_windows() {
288+
if builder.llvm_link_shared() && target.is_windows() && !target.ends_with("windows-gnullvm")
289+
{
289290
panic!("shared linking to LLVM is not currently supported on {}", target.triple);
290291
}
291292

0 commit comments

Comments
 (0)