Skip to content

Add riscv64gc-unknown-linux-musl#4813

Merged
rami3l merged 1 commit into
rust-lang:mainfrom
eshattow:riscv64musl
Jul 24, 2026
Merged

Add riscv64gc-unknown-linux-musl#4813
rami3l merged 1 commit into
rust-lang:mainfrom
eshattow:riscv64musl

Conversation

@eshattow

@eshattow eshattow commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

riscv6gc-unknown-linux-musl is now a Tier 2 target with host tools. Add support for it in rustup.

Additionally, add some missing riscv64gc-unknown-linux-gnu entries in rustup tree. The glibc dist build target name was renamed from dist-riscv64-linux to dist-riscv64-linux-gnu as part of the addition of musl dist build target.

@rustbot

This comment has been minimized.

@rami3l

rami3l commented Jun 15, 2026

Copy link
Copy Markdown
Member

@eshattow Hello, and sorry for the late reply 🙏

Are there any updates on this matter? Is this PR waiting for something to happen? I'd love to help if you need anything to land it. Many thanks in advance 🙇

@eshattow

Copy link
Copy Markdown
Contributor Author

Thanks @rami3l no actionables yet, I have been looking at the powerpc promotion (to Tier 2) PR as an example. Welcome any advice or guidance :-) I have an amd64 desktop to run the build, also StarFive JH7110 (riscv64gc) and SpacemiT K3 (riscv64a23) boards to build or test with. Admittedly I don't know much about rust or the build system previously this is from my viewpoint something that needs done to move along the official rust docker images that much CI/CD depends on in the GitHub-using community; learning as I go.

One point I am unclear about is if we have RISE RISC-V runners or not configured for the GitHub account? Should I be writing this as a cross-compiled build with amd64 or instead natively with the ubuntu-24.04-riscv runner; or is it a blend of both for build and test?

@rami3l

rami3l commented Jun 16, 2026

Copy link
Copy Markdown
Member

@eshattow Hello, thanks again for the update! I don't think we have riscv runners here at all, but in principle you won't need that to achieve Tier 2. So just adding a cross compilation target on Linux would be enough.

For a very recent example you can see #4908.

@eshattow eshattow changed the title RFC: Add riscv64 unknown linux musl support Add riscv64 unknown linux musl support Jul 23, 2026
@eshattow eshattow changed the title Add riscv64 unknown linux musl support Add riscv64-unknown-linux-musl Jul 23, 2026
@eshattow
eshattow marked this pull request as ready for review July 23, 2026 14:25
@eshattow
eshattow marked this pull request as draft July 24, 2026 02:15
@eshattow

Copy link
Copy Markdown
Contributor Author

Pending rollup of completed MCP 982 implementation.

@eshattow
eshattow force-pushed the riscv64musl branch 2 times, most recently from fdeb735 to 7423b04 Compare July 24, 2026 14:28
@eshattow eshattow changed the title Add riscv64-unknown-linux-musl Add riscv64gc-unknown-linux-musl Jul 24, 2026
@eshattow

Copy link
Copy Markdown
Contributor Author

Patches in upstream Linux for detection and reporting of RVA20 or RVA23 microarchitecture runtime environment (for example https://lore.kernel.org/linux-riscv/20260701-rva23u64-hwprobe-v2-v5-0-2c61f94a695a@gmail.com/ ) have not yet landed, so I remain here in rustup context with the assumption of RVA20 profile that is the most compatible. This will need some changes if/when RVA23 targets are promoted; I would tee this up to be prepared but there's not an agreed upon way to do it yet.

@eshattow
eshattow marked this pull request as ready for review July 24, 2026 14:56
@eshattow

Copy link
Copy Markdown
Contributor Author

@rami3l writes:

@eshattow Hello, thanks again for the update! I don't think we have riscv runners here at all, but in principle you won't need that to achieve Tier 2. So just adding a cross compilation target on Linux would be enough.

For a very recent example you can see #4908.

Thanks for that suggestion! I think I have implemented this as described, also see for reference MCP 982 tracking issue rust-lang/rust#156191 and the merge PR implementing that promotion to "with Tools" rust-lang/rust#158766

The uname -m reporting "riscv64" on RVA20 and RVA23 profiles may change in future but it is only proposed (elsewhere) to change the reporting for RVA23 and no changes to RVA20, RVA22. The difference of the profiles is most prominently the vector extensions mandated beginning with RVA23 and so a big performance impact there; out of scope for this pull request so we'll just assume if the host is reporting machine "riscv64" to fetch the Tier 2 build of glibc or musl target for RVA20 (riscv64gc).

Let me know what you think, thanks again! -E

@rami3l rami3l left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo some tiny nits, thanks!

As for the remaining concerns esp. regarding uname -m I believe we can address them when this target is actually enabled. For now keeping the most conservative/compatible approach sounds reasonable.

View changes since this review

Comment thread doc/user-guide/src/installation/other.md
Comment thread ci/actions-templates/linux-builds-template.yaml
@eshattow
eshattow force-pushed the riscv64musl branch 2 times, most recently from 18522bf to 0d2d502 Compare July 24, 2026 15:29
@rustbot

rustbot commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

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.

@rami3l
rami3l enabled auto-merge July 24, 2026 15:47
@rami3l
rami3l added this pull request to the merge queue Jul 24, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 24, 2026
@rami3l
rami3l added this pull request to the merge queue Jul 24, 2026
Merged via the queue into rust-lang:main with commit 0878429 Jul 24, 2026
31 checks passed
@eshattow
eshattow deleted the riscv64musl branch July 24, 2026 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants