-
Notifications
You must be signed in to change notification settings - Fork 69
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
Add support for the LoongArch architecture #518
Comments
This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed. cc @rust-lang/compiler @rust-lang/compiler-contributors |
All deleted as all my work shall be superseded now. |
@rustbot second |
@rustbot label -final-comment-period +major-change-accepted |
ci: Add support for dist-loongarch64-linux We are preparing to promote loongarch64-unknown-linux-gnu to Tier 2, and one of the tasks is to add CI support. We are currently in the process of upgrading the dependencies for the build tools, and before this is completed, we would like to request comments. Thanks #### Progress - [x] Update linux-raw-sys to 0.3.2 (rust-lang/cargo#11998) - [x] Update openssl-src to 111.25.3+1.1.1t (rust-lang/cargo#12005) - [x] bootstrap: Update linux-raw-sys to 0.3.2 (rust-lang#110516) - [x] Update linux-raw-sys to 0.3.4 (rust-lang#110518) - [x] Update cargo (rust-lang#110834) - [x] linux_like: Add missing constants for loongarch64 (rust-lang/libc#3237) - [x] Release 0.2.143 (rust-lang/libc#3236) - [x] Update libc to 0.2.144 (rust-lang/cargo#12098) - [x] Update cargo (rust-lang#111456) Tier 2 with host tools MCP: rust-lang/compiler-team#518
…imulacrum Promote loongarch64-unknown-linux-gnu to Tier 2 with host tools This PR promotes `loongarch64-unknown-linux-gnu` to Tier 2 (with host tools). MCP: rust-lang/compiler-team#518
ci: Add support for dist-loongarch64-linux We are preparing to promote loongarch64-unknown-linux-gnu to Tier 2, and one of the tasks is to add CI support. We are currently in the process of upgrading the dependencies for the build tools, and before this is completed, we would like to request comments. Thanks #### Progress - [x] Update linux-raw-sys to 0.3.2 (rust-lang/cargo#11998) - [x] Update openssl-src to 111.25.3+1.1.1t (rust-lang/cargo#12005) - [x] bootstrap: Update linux-raw-sys to 0.3.2 (rust-lang/rust#110516) - [x] Update linux-raw-sys to 0.3.4 (rust-lang/rust#110518) - [x] Update cargo (rust-lang/rust#110834) - [x] linux_like: Add missing constants for loongarch64 (rust-lang/libc#3237) - [x] Release 0.2.143 (rust-lang/libc#3236) - [x] Update libc to 0.2.144 (rust-lang/cargo#12098) - [x] Update cargo (rust-lang/rust#111456) Tier 2 with host tools MCP: rust-lang/compiler-team#518
Promote loongarch64-unknown-linux-gnu to Tier 2 with host tools This PR promotes `loongarch64-unknown-linux-gnu` to Tier 2 (with host tools). MCP: rust-lang/compiler-team#518
…iser Add new Tier-3 target: `loongarch64-unknown-linux-musl` MCP: rust-lang/compiler-team#518
…iser Add new Tier-3 target: `loongarch64-unknown-linux-musl` MCP: rust-lang/compiler-team#518
…iser Add new Tier-3 target: `loongarch64-unknown-linux-musl` MCP: rust-lang/compiler-team#518
…iser Add new Tier-3 target: `loongarch64-unknown-linux-musl` MCP: rust-lang/compiler-team#518
Rollup merge of rust-lang#121832 - heiher:loongarch64-musl, r=wesleywiser Add new Tier-3 target: `loongarch64-unknown-linux-musl` MCP: rust-lang/compiler-team#518
MCP: rust-lang/compiler-team#518 (cherry picked from commit d756375)
MCP: rust-lang/compiler-team#518 (cherry picked from commit d756375)
MCP: rust-lang/compiler-team#518 (cherry picked from commit d756375)
MCP: rust-lang/compiler-team#518 (cherry picked from commit d756375)
MCP: rust-lang/compiler-team#518 (cherry picked from commit d756375)
Proposal
tl;dr: Make LoongArch a new supported architecture, initially supporting the following 2 tuples:
loongarch64-unknown-linux-gnuf64
loongarch64-unknown-linux-muslf64
after the LoongArch ports of LLVM, glibc and musl fully land.
LoongArch is a new RISC architecture developed by the Loongson Technology Corporation, with pretty complete upstream support (binutils 2.38, gcc 12.1.0, linux v5.19-rc1, qemu 7.1). Ports for LLVM, glibc and musl are already under review, I'm one of the reviewers so I'll update this whenever new progress happens.
This architecture already has a small but growing user base in China, that mainly consists of software porters and hobbyist end-users for now (June 2022). Growth is expected to continue in the coming years, expanding to the general consumer market. The architecture is capable of full-fledged desktop and server workload alike, in addition to SoC models intended for embedded.
Latest version of the LoongArch ELF psABI specification can be found here, while current toolchain convention document is available here. The ISA manual (currently revision v1.00) is here; new ISA revisions are expected to keep backwards compatibility so we don't need to encode the revision in the target tuple (ideally just configure
target-cpu
just like any other arch).The LoongArch ABI is modeled after that of RISC-V, so there are 6 ABIs in total (LP64/ILP32; soft-float, SP/DP hard-float). The only fully developed ABI is LP64D, others are mostly unusable right now. According to the toolchain convention doc, the Debian multiarch tuples for LP64D are
loongarch64-linux-gnuf64
(glibc) andloongarch64-linux-muslf64
(musl) respectively, so we should pickloongarch64-unknown-linux-gnuf64
andloongarch64-unknown-linux-muslf64
for the Rust tuples.Eventually, the
loongarch64-unknown-linux-gnuf64
target should reach Tier 2 with host tools status, because this platform can, and is used, for serious development work, but is not expected to gain enough adoption to be considered Tier 1. The musl target should eventually get to Tier 2 as well; but for the initial bring-up, starting at Tier 3 is expected, for the code to gradually appear and settle.I'm posting this before all the necessary ports (esp. LLVM) are ready, for convenience and early comments. Some of the ports were rushed (as is the architecture itself), and we really don't want to rush another project.
(Disclaimer: I'm not affiliated with Loongson or any of the Loongson ecosystem companies.)
Mentors or Reviewers
I haven't done serious Rust work recently (my last serious change predated the MCP process, actually) so I don't know who to put here; but I can mentor or do the whole port myself (I polished the Rust MIPS support back in 2015/16, and the basic flow hasn't changed since).
Process
The main points of the Major Change Process are as follows:
@rustbot second
.-C flag
, then full team check-off is required.@rfcbot fcp merge
on either the MCP or the PR.You can read more about Major Change Proposals on forge.
Comments
This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.
The text was updated successfully, but these errors were encountered: