.arg(build.src.join("src/librustc_trans/Cargo.toml"));
rustc_cargo_env(build, &mut cargo);
+ let _folder = build.fold_output(|| format!("stage{}-rustc_trans", compiler.stage));
+
match &*self.backend {
"llvm" | "emscripten" => {
// Build LLVM for our target. This will implicitly build the
features.push_str(" emscripten");
}
- let _folder = build.fold_output(|| format!("stage{}-rustc_trans", compiler.stage));
println!("Building stage{} codegen artifacts ({} -> {}, {})",
compiler.stage, &compiler.host, target, self.backend);
}
}
+fn copy_lld_to_sysroot(builder: &Builder,
+ target_compiler: Compiler,
+ lld_install_root: &Path) {
+ let target = target_compiler.host;
+
+ let dst = builder.sysroot_libdir(target_compiler, target)
+ .parent()
+ .unwrap()
+ .join("bin");
+ t!(fs::create_dir_all(&dst));
+
+ let exe = exe("lld", &target);
+ copy(&lld_install_root.join("bin").join(&exe), &dst.join(&exe));
+}
+
/// Cargo's output path for the standard library in a given stage, compiled
/// by a particular compiler for the specified target.
pub fn libstd_stamp(build: &Build, compiler: Compiler, target: Interned<String>) -> PathBuf {
}
}
+ let lld_install = if build.config.lld_enabled && target_compiler.stage > 0 {
+ Some(builder.ensure(native::Lld {
+ target: target_compiler.host,
+ }))
+ } else {
+ None
+ };
+
let stage = target_compiler.stage;
let host = target_compiler.host;
println!("Assembling stage{} compiler ({})", stage, host);
copy_codegen_backends_to_sysroot(builder,
build_compiler,
target_compiler);
+ if let Some(lld_install) = lld_install {
+ copy_lld_to_sysroot(builder, target_compiler, &lld_install);
+ }
// Link the compiler binary itself into place
let out_dir = build.cargo_out(build_compiler, Mode::Librustc, host);