Auto merge of #119378 - onur-ozkan:utilize-llvm-tools, r=albertlarsan68

utilize the unused `llvm-tools` option

This field was not functioning as described in its comment in `config.example.toml`. Also, updated the default value to `true` to keep the bootstrapping behavior as it was before.

cc `@Zalathar`
This commit is contained in:
bors 2023-12-29 00:04:34 +00:00
commit 63623043f7
4 changed files with 11 additions and 9 deletions

View File

@ -661,7 +661,7 @@
# Indicates whether some LLVM tools, like llvm-objdump, will be made available in the # Indicates whether some LLVM tools, like llvm-objdump, will be made available in the
# sysroot. # sysroot.
#llvm-tools = false #llvm-tools = true
# Whether to deny warnings in crates # Whether to deny warnings in crates
#deny-warnings = true #deny-warnings = true

View File

@ -1738,7 +1738,7 @@ impl Step for Assemble {
if builder.config.rust_codegen_backends.contains(&INTERNER.intern_str("llvm")) { if builder.config.rust_codegen_backends.contains(&INTERNER.intern_str("llvm")) {
let llvm::LlvmResult { llvm_config, .. } = let llvm::LlvmResult { llvm_config, .. } =
builder.ensure(llvm::Llvm { target: target_compiler.host }); builder.ensure(llvm::Llvm { target: target_compiler.host });
if !builder.config.dry_run() { if !builder.config.dry_run() && builder.config.llvm_tools_enabled {
let llvm_bin_dir = output(Command::new(llvm_config).arg("--bindir")); let llvm_bin_dir = output(Command::new(llvm_config).arg("--bindir"));
let llvm_bin_dir = Path::new(llvm_bin_dir.trim()); let llvm_bin_dir = Path::new(llvm_bin_dir.trim());

View File

@ -2157,6 +2157,7 @@ impl Step for LlvmTools {
tarball.set_overlay(OverlayKind::LLVM); tarball.set_overlay(OverlayKind::LLVM);
tarball.is_preview(true); tarball.is_preview(true);
if builder.config.llvm_tools_enabled {
// Prepare the image directory // Prepare the image directory
let src_bindir = builder.llvm_out(target).join("bin"); let src_bindir = builder.llvm_out(target).join("bin");
let dst_bindir = format!("lib/rustlib/{}/bin", target.triple); let dst_bindir = format!("lib/rustlib/{}/bin", target.triple);
@ -2164,6 +2165,7 @@ impl Step for LlvmTools {
let exe = src_bindir.join(exe(tool, target)); let exe = src_bindir.join(exe(tool, target));
tarball.add_file(&exe, &dst_bindir, 0o755); tarball.add_file(&exe, &dst_bindir, 0o755);
} }
}
// Copy libLLVM.so to the target lib dir as well, so the RPATH like // Copy libLLVM.so to the target lib dir as well, so the RPATH like
// `$ORIGIN/../lib` can find it. It may also be used as a dependency // `$ORIGIN/../lib` can find it. It may also be used as a dependency

View File

@ -1630,7 +1630,7 @@ impl Config {
); );
} }
set(&mut config.llvm_tools_enabled, llvm_tools); config.llvm_tools_enabled = llvm_tools.unwrap_or(true);
config.rustc_parallel = config.rustc_parallel =
parallel_compiler.unwrap_or(config.channel == "dev" || config.channel == "nightly"); parallel_compiler.unwrap_or(config.channel == "dev" || config.channel == "nightly");
config.rustc_default_linker = default_linker; config.rustc_default_linker = default_linker;