Repository navigation
Open
Labels
A-dist-componentsArea: dist components, e.g. `rustc-dev`, `rustc-src`, etc.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-releaseRelevant to the release subteam, which will review and decide on the PR/issue.
Description
This is a tracking issue for the llvm-tools-preview.
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Discussion comments will get marked as off-topic or deleted.
Repeated discussions on the tracking issue may lead to the tracking issue getting locked.
Details
llvm-tools-preview is a rustup component that contains some LLVM tools. At the time of this writing, it contains the following:
- llc
- llvm-ar
- llvm-as
- llvm-cov
- llvm-dis
- llvm-nm
- llvm-objcopy
- llvm-objdump
- llvm-profdata
- llvm-readobj
- llvm-size
- llvm-strip
- opt
Steps
- Write some documentation (not sure where this should live)
Unresolved Questions
- What will it take to transition out of
-preview?- NOTE: The
llvm-toolscomponent was inadvertently made available. It is likely de facto stable now. See comment below.
- NOTE: The
- What is the stability story? See comment below.
- Where will this be documented?
- Who is responsible for the component?
- Which directory should the component files live?
Implementation history
- Ship more LLVM tools with the Rust toolchain #49584 Original issue
- ship LLVM tools with the toolchain #50336 Added tools
- rename the llvm-tools component to llvm-tools-preview and tweak its image #51922 Renamed to
-preview - Provide llvm-strip in llvm-tools component #51962 Added llvm-strip
- add llvm-readobj to llvm-tools-preview #53740 Added llvm-readobj
- Include llvm-ar with llvm-tools component #59351 Added llvm-ar
- Move the target libLLVM to llvm-tools-preview #72000 Moved libLLVM.so around
- Include
llvm-dis,llcandoptinllvm-tools-previewcomponent #77868 Added llvm-dis, llc, opt - Ship llvm-cov through llvm-tools #78947 Added llvm-cov
- Include llvm-as in llvm-tools-preview component #78968 Added llvm-as
Reacted by Chaoses-Ib
Metadata
Metadata
Assignees
Labels
A-dist-componentsArea: dist components, e.g. `rustc-dev`, `rustc-src`, etc.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-releaseRelevant to the release subteam, which will review and decide on the PR/issue.
Activity
lf- commentedon Jan 1, 2022
Related issue: #56371
The use case that I want clang for is the integrated assembler, for assembling .s files in my rust kernel build process. I don't believe that there's currently any way of invoking the llvm based assembler except through the clang driver.
hellow554 commentedon Jan 2, 2022
If you are using a nightly compiler you could use the
asm!macro?lf- commentedon Jan 2, 2022
Not really, if you are a kernel. Generally you want your init code and similarly large pieces of assembly outside of rust files, since you want to create jump tables and such that don't belong to a function, among other things. It's rather hacky to try to do everything with inline assembly.
hellow554 commentedon Jan 2, 2022
What about
global_asm!together withinclude_str!? 🤔tv42 commentedon Jan 12, 2024
These seem to be now available as "llvm-tools" (no "-preview"). Did this issue get accidentally left behind?
ehuss commentedon Jan 12, 2024
It was inadvertent that the component without the
-previewsuffix was allowed. This is currently tracked in #119164.ehuss commentedon Mar 12, 2024
There was a discussion at https://rust-lang.zulipchat.com/#narrow/stream/241545-t-release/topic/llvm-tools.20stabilization about the accidental removal of the
-previewsuffix.I think to summarize: People agree that we should not remove the
llvm-toolscomponent and break users currently using it. However, it doesn't seem like there is consensus it should be treated as stable. I have posted rust-lang/rustup#3707 to add a comment about the status.I had some uncertainty about who is actually responsible for this component. I think by default it should probably be the compiler team delegating to wg-llvm if needed.
There is some uncertainty about the directory where the tools currently reside. Currently they are in the target directory, but they are host tools so they should probably be located somewhere else. There should also probably be a
rustc --printoption for locating that directory. (I assume it should not be in$SYSROOT/bin, since that seems like it could really break things if people have that in their PATH.)I'll also copy @wesleywiser's last comment, which seemed like a good summary:
dancrossnyc commentedon Sep 13, 2024
I noticed that, on tonight's nightly, the contents of
llvm-toolsappears to be, either in whole or in very large part, in another component:rustupcomplained about conflicts withllc. As an experiment, I removedllvm-toolsand updated and was surprised to see that e.g.llvm-objdumpwas still installed.Is this expected?
ehuss commentedon Sep 13, 2024
@dancrossnyc, there was a regression in the latest nightly, see #130291. It should be fixed in the next nightly tonight.
dancrossnyc commentedon Sep 13, 2024
Good to go. Thank you, Eric!
mrwsl commentedon Sep 19, 2024
I just updated to llvm19 and now grcov is complaining about mismatching versions for llvm-profdata and the raw data. I wondered how the bins are updated and where I could follow updates?
yuhui518 commentedon Apr 1, 2025
My issue is:
ation profile format version
warning: /tmp/.tmpfHs8e8/cov-21560-15860613078634779016_0_1.profraw: unsupported instrumentation profile format version
error: no profile can be merged
12:42:34 [ERROR] Error while executing llvm tools: Failure while running "/linux/llvm/bin/llvm-profdata" "merge" "-f" "-" "-sparse" "-o" "/tmp/.tmpfHs8e8/0/grcov.profdata"
[root@localhost ut]# cargo -V
warning:
/root/.cargo/configis deprecated in favor ofconfig.tomlnote: if you need to support cargo 1.38 or earlier, you can symlink
configtoconfig.tomlcargo 1.81.0 (2dbb1af80 2024-08-20)
[root@localhost bin]#./llvm-profdata show --version
LLVM (http://llvm.org/):
LLVM version 15.0.4
Optimized build.
Default target: x86_64-unknown-linux-gnu
[root@localhost bin]# ./clang --version
clang version 15.0.4 (llvm-project 9176a70a8154b7ab1764e6e94f6ab58bc9f9b189)
Target: x86_64-unknown-linux-gnu
Llvm-profdata and clang is same version,I don't know why this problem occurred?
djc commentedon Apr 1, 2025
I'm guessing it's because your llvm-profdata is out of sync with the LLVM toolchain that Rust used for 1.81, which is much newer. (I don't have 1.81 handy right now, but 1.80 used LLVM 18.1.7; 1.85 uses 19.1.7.)
Rename `llvm-tools-preview` component to `llvm-tools` (#658)