Skip to content

llvm-* and llc binaries missing from rustc build #140913

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
iyernaveenr opened this issue May 11, 2025 · 1 comment · May be fixed by #140932
Open

llvm-* and llc binaries missing from rustc build #140913

iyernaveenr opened this issue May 11, 2025 · 1 comment · May be fixed by #140932
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@iyernaveenr
Copy link
Contributor

iyernaveenr commented May 11, 2025

Location

https://rustc-dev-guide.rust-lang.org/backend/debugging.html#filing-llvm-bug-reports
Quoting one of the bullets from the above link:
"
If you have compiled rustc yourself somewhere, in the target directory you have binaries for llc, opt, etc.
"

Summary

In one of my older compiler builds, back when there used to be config.example.toml (as opposed to the current bootstrap.example.toml), I could find all the llvm-* tools as shown below:

~/FOO_rustc_source/rust$ tree ../FOO_installed_1/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/bin/
../FOO_installed_1/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/bin/
├── gcc-ld
│   ├── ld64.lld
│   ├── ld.lld
│   ├── lld-link
│   └── wasm-ld
├── llc
├── llvm-ar
├── llvm-as
├── llvm-cov
├── llvm-dis
├── llvm-link
├── llvm-nm
├── llvm-objcopy
├── llvm-objdump
├── llvm-profdata
├── llvm-readobj
├── llvm-size
├── llvm-strip
├── opt
├── rust-lld
└── wasm-component-ld

The top-of-tree commit back then was:

commit 32b17d56eb02495f9865028e1f7271a3a48c0b9b (HEAD -> master, origin/master, origin/HEAD)
Merge: 66701c42263 675f447d886
Author: bors <[email protected]>
Date:   Mon Oct 28 10:44:24 2024 +0000

    Auto merge of #132244 - jyn514:linker-refactors, r=bjorn3
    
    fix various linker warnings
    
    separated out from https://github.com/rust-lang/rust/pull/119286; this doesn't have anything user-facing, i just want to land these changes so i can stop rebasing them.
    
    r? `@bjorn3`

However, now, I am on top of the following commit:

commit e9f8103f93f8ce2fa2c15c0c6796ec821f8ae15d (HEAD -> master, origin/master, origin/HEAD)
Merge: 3ef8e64ce9f ffa7d1ee5db
Author: bors <[email protected]>
Date:   Wed May 7 19:49:36 2025 +0000

    Auto merge of #140590 - lcnr:closure-in-dead-code, r=compiler-errors
    
    borrowck nested items in dead code
    
    fixes https://github.com/rust-lang/rust/issues/140583
    
    r? `@compiler-errors`

With this, I no longer see any of the llvm-* and llc binaries as shown below:

~/FOO_rustc_source_20250507/rust$ tree ../FOO_installed_23/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/bin/
../FOO_installed_23/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/bin/
├── gcc-ld
│   ├── ld64.lld
│   ├── ld.lld
│   ├── lld-link
│   └── wasm-ld
├── rust-lld
└── rust-objcopy

1 directory, 6 files

I tried to modify bootstrap.example.toml and then cp bootstrap.example.toml bootstrap.toml, before running ./x.py build && ./x.py install as shown below, but to no avail:

~/FOO_rustc_source_20250507/rust$ git diff bootstrap.example.toml
diff --git a/bootstrap.example.toml b/bootstrap.example.toml
index 1371fd6442f..32a73b484c3 100644
--- a/bootstrap.example.toml
+++ b/bootstrap.example.toml
@@ -737,11 +740,12 @@
 
 # Indicates whether some LLVM tools, like llvm-objdump, will be made available in the
 # sysroot.
-#llvm-tools = true
+llvm-tools = true
 
 # Indicates whether the `self-contained` llvm-bitcode-linker, will be made available
 # in the sysroot. It is required for running nvptx tests.
 #llvm-bitcode-linker = false
+llvm-bitcode-linker = true
 
 # Whether to deny warnings in crates
 #deny-warnings = true

What should I do to have these llvm-* binaries also get built as part of the compiler build process?

@iyernaveenr iyernaveenr added the A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools label May 11, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label May 11, 2025
@moxian

This comment has been minimized.

@rustbot rustbot added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label May 11, 2025
@onur-ozkan onur-ozkan added C-bug Category: This is a bug. and removed A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels May 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants