Skip to content

Enable split_debuginfo=packed/unpacked for RISC-V#155135

Open
kxxt wants to merge 1 commit intorust-lang:mainfrom
kxxt:riscv-split-dwarf
Open

Enable split_debuginfo=packed/unpacked for RISC-V#155135
kxxt wants to merge 1 commit intorust-lang:mainfrom
kxxt:riscv-split-dwarf

Conversation

@kxxt
Copy link
Copy Markdown
Contributor

@kxxt kxxt commented Apr 11, 2026

The packed/unpacked options are disabled for this target in #120518.
Now they are implemented in LLVM 22.1: llvm/llvm-project#56642 (comment).

Note that I am not sure about the minimum supported LLVM version for rustc.
This PR could wait for some time if the minimum supported LLVM version is below 22.1 on nightly/1.96.0.

Tests done

  • build/host/stage1/bin/rustc --edition=2024 src/main.rs --crate-type bin -C debuginfo=2 -C split-debuginfo=packed --target riscv64gc-unknown-linux-gnu -C linker=riscv64-linux-gnu-gcc
  • build/host/stage1/bin/rustc --edition=2024 src/main.rs --crate-type bin -C debuginfo=2 -C split-debuginfo=unpacked --target riscv64gc-unknown-linux-gnu -C linker=riscv64-linux-gnu-gcc
run `./x test` on riscv64 linux to confirm the re-enabled tests pass. The only failure is #148748
failures:

---- [ui] tests/ui/explicit-tail-calls/become-indirect-return.rs stdout ----

error: test compilation failed although it shouldn't!
status: exit status: 101
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/home/kxxt/rust/build/riscv64gc-unknown-linux-gnu/stage1/bin/rustc" "/home/kxxt/rust/tests/ui/explicit-tail-calls/become-indirect-return.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/home/kxxt/.cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/home/kxxt/rust/vendor" "--sysroot" "/home/kxxt/rust/build/riscv64gc-unknown-linux-gnu/stage1" "--target=riscv64gc-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "-O" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "-o" "/home/kxxt/rust/build/riscv64gc-unknown-linux-gnu/test/ui/explicit-tail-calls/become-indirect-return/a" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/home/kxxt/rust/build/riscv64gc-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
rustc-LLVM ERROR: failed to perform tail call elimination on a call site marked musttail
------------------------------------------

---- [ui] tests/ui/explicit-tail-calls/become-indirect-return.rs stdout end ----

failures:
    [ui] tests/ui/explicit-tail-calls/become-indirect-return.rs

test result: FAILED. 19741 passed; 1 failed; 404 ignored; 0 measured; 0 filtered out; finished in 541.49s

Some tests failed in compiletest suite=ui mode=ui host=riscv64gc-unknown-linux-gnu target=riscv64gc-unknown-linux-gnu
Build completed unsuccessfully in 0:11:53

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 11, 2026

These commits modify compiler targets.
(See the Target Tier Policy.)

@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 11, 2026
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Apr 11, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 11, 2026

r? @TaKO8Ki

rustbot has assigned @TaKO8Ki.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 69 candidates
  • Random selection from 11 candidates

@kxxt
Copy link
Copy Markdown
Contributor Author

kxxt commented Apr 11, 2026

This PR could wait for some time if the minimum supported LLVM version is below 22.1 on nightly/1.96.0.

Or is there any internal conditional compilation mechanism that I could use to disable packed/unpacked if the LLVM version is less than 22.1?

@TaKO8Ki
Copy link
Copy Markdown
Member

TaKO8Ki commented Apr 11, 2026

It seems that the minimum supported LLVM version is 21.x. #153684

if let (Some(major), Some(_minor)) = (parts.next(), parts.next())
&& major >= 21
{
return;
}

Or is there any internal conditional compilation mechanism that I could use to disable packed/unpacked if the LLVM version is less than 22.1?

I don’t think there’s an existing generic mechanism for this.

@kxxt
Copy link
Copy Markdown
Contributor Author

kxxt commented Apr 11, 2026

Or is there any internal conditional compilation mechanism that I could use to disable packed/unpacked if the LLVM version is less than 22.1?

I don’t think there’s an existing generic mechanism for this.

Thanks! Then it's better waiting for the bump of minimum LLVM version to 22.1.

@kxxt
Copy link
Copy Markdown
Contributor Author

kxxt commented Apr 11, 2026

@rustbot label A-LLVM O-riscv

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. O-riscv Target: RISC-V architecture labels Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-run-make Area: port run-make Makefiles to rmake.rs O-riscv Target: RISC-V architecture S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants