-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Add support for xray in aarch64 unknown none target #148666
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
base: main
Are you sure you want to change the base?
Conversation
|
These commits modify compiler targets. |
|
r? @wesleywiser rustbot has assigned @wesleywiser. Use |
This comment has been minimized.
This comment has been minimized.
|
@wesleywiser were you able to take a look yet? As far as I can tell CI failed because CI was in general broken at that point in time, I unfortunately can not rerun the pipeline. |
|
☔ The latest upstream changes (presumably #149581) made this pull request unmergeable. Please resolve the merge conflicts. |
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This comment has been minimized.
This comment has been minimized.
|
Anything from my side to do here? |
I am currently working on an embedded project and use the target
aarch64-unknown-none, which I want to profile.I found the following compiler flag
-Z instrument-xray(https://doc.rust-lang.org/unstable-book/compiler-flags/instrument-xray.html) available and I locally built a toolchain that sets thesupports_xray: trueoption inTargetOptionsforcompiler/rustc_target/src/spec/targets/aarch64_unknown_none.rs.Using this toolchain in
rustupI am able to use the instrumentation pass and I verified that the disassembly looks as what I want.I understand that it isn't available upstream while being supported due to the separate runtime library which has to be linked (e.g., https://www.llvm.org/docs/XRay.html#xray-runtime-library), which is not available for
aarch64-unknown-none.I argue that someone who cross-compiles for
aarch64-unknown-nonewould be okay with writing a separate runtime library themselves, which I intend to do.As far as I understood it is not necessarily required to have a runtime library at this point, i.e., the user of this API should link it, e.g., from their
build.rsfile usingcargo::rustc-link-lib=LIBif there is an XRay LIB available for the respective target, e.g.,clang+llvm-19.1.1-aarch64-linux-gnu/lib/clang/19/lib/aarch64-unknown-linux-gnu/libclang_rt.xray-fdr.a(which afaik there isn't foraarch64-unknown-none) and do "configuration as code" of XRay's options.It should not be part of the compiler, because the instrumentation and the runtime library are completely decoupled. One can modify the instrumented code by the compiler pass however one wants to, this again pushes me into the direction of telling the developer to bring his own runtime library.
I would like to bring my change that enables this instrumentation back into upstream to facilitate my developer experience.