Skip to content

Commit 292cafe

Browse files
committed
Disable building rustc with (Thin)LTO on Windows
1 parent bb548f9 commit 292cafe

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/bootstrap/compile.rs

+7
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,13 @@ impl Step for Rustc {
817817
if compiler.stage != 0 {
818818
match builder.config.rust_lto {
819819
RustcLto::Thin | RustcLto::Fat => {
820+
if target == "x86_64-pc-windows-msvc" {
821+
panic!(
822+
"(Thin)LTO is currently known to produce miscompilations on `x86_64-pc-windows-msvc`. \
823+
See https://github.com/rust-lang/rust/issues/109067."
824+
);
825+
}
826+
820827
// Since using LTO for optimizing dylibs is currently experimental,
821828
// we need to pass -Zdylib-lto.
822829
cargo.rustflag("-Zdylib-lto");

0 commit comments

Comments
 (0)