-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Replace the \01__gnu_mcount_nc to LLVM intrinsic for ARM #113814
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
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @TaKO8Ki (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
Hi @TaKO8Ki, is anything preventing the merging of this PR? Because of this issue, we are unable to trace on our target platform at all. |
r? @davidtwco |
These commits modify compiler targets. |
This comment has been minimized.
This comment has been minimized.
Current `-Zinstrument-mcount` for ARM32 use the `\01__gnu_mcount_nc` directly for its instrumentation function. However, the LLVM does not use this mcount function directly, but it wraps it to intrinsic, `llvm.arm.gnu.eabi.mcount` and the transform pass also only handle the intrinsic. As a result, current `-Zinstrument-mcount` not work on ARM32. Refer: namhyung/uftrace#1764 This commit replaces the mcount name from native function to the LLVM intrinsic so that the transform pass can handle it. Signed-off-by: ChoKyuWon <[email protected]>
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (2ceed0b): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 633.83s -> 634.323s (0.08%) |
Replace the \01__gnu_mcount_nc to LLVM intrinsic for additional ARM targets This is an extension to rust-lang#113814 which seems to have missed two targets which also need this patch for instrumentation with `-Z instrument-mcount` to work correctly. For anyone who might stumble over this issue again in the future: As a workaround one can dump the current target configuration using ``` rustc +nightly -Z unstable-options --target armv7-unknown-linux-gnueabihf --print target-spec-json ``` (assuming `armv7-unknown-linux-gnueabihf` is the target to build for) add the line ``` "llvm-mcount-intrinsic": "llvm.arm.gnu.eabi.mcount", ``` and compile with ``` RUSTFLAGS="-Z instrument-mcount -C passes=ee-instrument<post-inline>" cargo +nightly build -Z build-std --target <path to directory with modified target config>/armv7-unknown-linux-gnueabihf.json ``` It might be necessary to set the compiler for cross compiling using something like ``` export TARGET_CC=arm-linux-gnueabihf-gcc ```
Rollup merge of rust-lang#140433 - BjoernLange:master, r=nnethercote Replace the \01__gnu_mcount_nc to LLVM intrinsic for additional ARM targets This is an extension to rust-lang#113814 which seems to have missed two targets which also need this patch for instrumentation with `-Z instrument-mcount` to work correctly. For anyone who might stumble over this issue again in the future: As a workaround one can dump the current target configuration using ``` rustc +nightly -Z unstable-options --target armv7-unknown-linux-gnueabihf --print target-spec-json ``` (assuming `armv7-unknown-linux-gnueabihf` is the target to build for) add the line ``` "llvm-mcount-intrinsic": "llvm.arm.gnu.eabi.mcount", ``` and compile with ``` RUSTFLAGS="-Z instrument-mcount -C passes=ee-instrument<post-inline>" cargo +nightly build -Z build-std --target <path to directory with modified target config>/armv7-unknown-linux-gnueabihf.json ``` It might be necessary to set the compiler for cross compiling using something like ``` export TARGET_CC=arm-linux-gnueabihf-gcc ```
Current
-Zinstrument-mcount
for ARM32 use the\01__gnu_mcount_nc
directly for its instrumentation function.However, the LLVM does not use this mcount function directly, but it wraps it to intrinsic,
llvm.arm.gnu.eabi.mcount
and the transform pass also only handle the intrinsic.As a result, current
-Zinstrument-mcount
not work on ARM32. Refer: namhyung/uftrace#1764This commit replaces the mcount name from native function to the LLVM intrinsic so that the transform pass can handle it.