Skip to content

Commit ebbd715

Browse files
committed
Auto merge of #114480 - ozkanonur:fix-stage0-compiler-llvm, r=Mark-Simulacrum
copy the correct version of LLVM into the stage0 sysroot In some cases(see #109314), when the stage0 compiler relies on more recent version of LLVM than the beta compiler, it may not be able to locate the correct LLVM in the sysroot. This situation typically occurs when we upgrade LLVM version while the beta compiler continues to use an older version. Fixes #109314
2 parents 644e806 + aec4b59 commit ebbd715

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/bootstrap/compile.rs

+10
Original file line numberDiff line numberDiff line change
@@ -1384,6 +1384,16 @@ impl Step for Sysroot {
13841384
let _ = fs::remove_dir_all(&sysroot);
13851385
t!(fs::create_dir_all(&sysroot));
13861386

1387+
// In some cases(see https://github.com/rust-lang/rust/issues/109314), when the stage0
1388+
// compiler relies on more recent version of LLVM than the beta compiler, it may not
1389+
// be able to locate the correct LLVM in the sysroot. This situation typically occurs
1390+
// when we upgrade LLVM version while the beta compiler continues to use an older version.
1391+
//
1392+
// Make sure to add the correct version of LLVM into the stage0 sysroot.
1393+
if compiler.stage == 0 {
1394+
dist::maybe_install_llvm_target(builder, compiler.host, &sysroot);
1395+
}
1396+
13871397
// If we're downloading a compiler from CI, we can use the same compiler for all stages other than 0.
13881398
if builder.download_rustc() && compiler.stage != 0 {
13891399
assert_eq!(

0 commit comments

Comments
 (0)