Skip to content

Commit

Permalink
Fix lld detection if stage0 rustc built with custom libdir
Browse files Browse the repository at this point in the history
  • Loading branch information
o01eg committed May 29, 2020
1 parent 4512721 commit ce72299
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,13 +344,19 @@ impl Build {
// we always try to use git for LLVM builds
let in_tree_llvm_info = channel::GitInfo::new(false, &src.join("src/llvm-project"));

let initial_sysroot = config.initial_rustc.parent().unwrap().parent().unwrap();
let initial_lld = initial_sysroot
.join("lib")
.join("rustlib")
.join(config.build)
.join("bin")
.join("rust-lld");
let initial_target_libdir = if config.dry_run {
"/dummy/path/to/lib/".to_string()
} else {
output(
Command::new(&config.initial_rustc)
.arg("--target")
.arg(config.build)
.arg("--print")
.arg("target-libdir"),
)
};
let initial_lld =
Path::new(&initial_target_libdir).parent().unwrap().join("bin").join("rust-lld");

let mut build = Build {
initial_rustc: config.initial_rustc.clone(),
Expand Down

0 comments on commit ce72299

Please sign in to comment.