Skip to content

Commit 6362304

Browse files
committed
Auto merge of rust-lang#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`
2 parents fb5ed72 + 12190e5 commit 6362304

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

Diff for: config.example.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@
661661

662662
# Indicates whether some LLVM tools, like llvm-objdump, will be made available in the
663663
# sysroot.
664-
#llvm-tools = false
664+
#llvm-tools = true
665665

666666
# Whether to deny warnings in crates
667667
#deny-warnings = true

Diff for: src/bootstrap/src/core/build_steps/compile.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1738,7 +1738,7 @@ impl Step for Assemble {
17381738
if builder.config.rust_codegen_backends.contains(&INTERNER.intern_str("llvm")) {
17391739
let llvm::LlvmResult { llvm_config, .. } =
17401740
builder.ensure(llvm::Llvm { target: target_compiler.host });
1741-
if !builder.config.dry_run() {
1741+
if !builder.config.dry_run() && builder.config.llvm_tools_enabled {
17421742
let llvm_bin_dir = output(Command::new(llvm_config).arg("--bindir"));
17431743
let llvm_bin_dir = Path::new(llvm_bin_dir.trim());
17441744

Diff for: src/bootstrap/src/core/build_steps/dist.rs

+8-6
Original file line numberDiff line numberDiff line change
@@ -2157,12 +2157,14 @@ impl Step for LlvmTools {
21572157
tarball.set_overlay(OverlayKind::LLVM);
21582158
tarball.is_preview(true);
21592159

2160-
// Prepare the image directory
2161-
let src_bindir = builder.llvm_out(target).join("bin");
2162-
let dst_bindir = format!("lib/rustlib/{}/bin", target.triple);
2163-
for tool in LLVM_TOOLS {
2164-
let exe = src_bindir.join(exe(tool, target));
2165-
tarball.add_file(&exe, &dst_bindir, 0o755);
2160+
if builder.config.llvm_tools_enabled {
2161+
// Prepare the image directory
2162+
let src_bindir = builder.llvm_out(target).join("bin");
2163+
let dst_bindir = format!("lib/rustlib/{}/bin", target.triple);
2164+
for tool in LLVM_TOOLS {
2165+
let exe = src_bindir.join(exe(tool, target));
2166+
tarball.add_file(&exe, &dst_bindir, 0o755);
2167+
}
21662168
}
21672169

21682170
// Copy libLLVM.so to the target lib dir as well, so the RPATH like

Diff for: src/bootstrap/src/core/config/config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1630,7 +1630,7 @@ impl Config {
16301630
);
16311631
}
16321632

1633-
set(&mut config.llvm_tools_enabled, llvm_tools);
1633+
config.llvm_tools_enabled = llvm_tools.unwrap_or(true);
16341634
config.rustc_parallel =
16351635
parallel_compiler.unwrap_or(config.channel == "dev" || config.channel == "nightly");
16361636
config.rustc_default_linker = default_linker;

0 commit comments

Comments
 (0)