Skip to content

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

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

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

Conversation

@kxxt

@kxxt kxxt commented Apr 11, 2026

Copy link
Copy Markdown
Contributor

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

rustbot commented Apr 11, 2026

Copy link
Copy Markdown
Collaborator

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

rustbot commented Apr 11, 2026

Copy link
Copy Markdown
Collaborator

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

kxxt commented Apr 11, 2026

Copy link
Copy Markdown
Contributor Author

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

TaKO8Ki commented Apr 11, 2026

Copy link
Copy Markdown
Member

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

kxxt commented Apr 11, 2026

Copy link
Copy Markdown
Contributor Author

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

kxxt commented Apr 11, 2026

Copy link
Copy Markdown
Contributor Author

@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
@rust-bors

rust-bors Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #156023) made this pull request unmergeable. Please resolve the merge conflicts.

@apiraino

apiraino commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Visited during triage.

@TaKO8Ki are you still ok with reviewing this or would you prefer handling this to someone from @rust-lang/wg-llvm ?

thanks

@TaKO8Ki

TaKO8Ki commented Jun 18, 2026

Copy link
Copy Markdown
Member

@apiraino I’m ok to review this pr, but we are waiting for the update. Please refer to this comment. #155135 (comment)

@kxxt

kxxt commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

@rustbot label -S-waiting-on-review S-waiting-on-LLVM llvm-fixed-upstream

@rustbot rustbot added llvm-fixed-upstream Issue expected to be fixed by the next major LLVM upgrade, or backported fixes S-waiting-on-LLVM Status: the compiler-dragon is eepy, can someone get it some tea? and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 18, 2026
@apiraino

Copy link
Copy Markdown
Contributor

oh thank you, didn't notice that. Are we are specifically waiting on a patch update to downstream a fix (llvm/llvm-project#169653) for llvm/llvm-project#56642 ?

The very latest downstream merge was 3 days ago (22.1.7)
https://redirect.github.com/rust-lang/rust/pull/157899

(I'm not super-familiar with LLVM releases)

@kxxt

kxxt commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

oh thank you, didn't notice that. Are we are specifically waiting on a patch update to downstream a fix (llvm/llvm-project#169653) for llvm/llvm-project#56642 ?

Yes.

The very latest downstream merge was 3 days ago (22.1.7) https://redirect.github.com/rust-lang/rust/pull/157899

We are waiting for the bump of minimum supported LLVM version to 22. Although the in-tree version of LLVM has been bumped to 22, it is still possible to build rust with external LLVM 21, where applying this patch would cause a regression.

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 llvm-fixed-upstream Issue expected to be fixed by the next major LLVM upgrade, or backported fixes O-riscv Target: RISC-V architecture S-waiting-on-LLVM Status: the compiler-dragon is eepy, can someone get it some tea? 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.

4 participants