-
Notifications
You must be signed in to change notification settings - Fork 1k
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 loongarch64 support #2765
Add loongarch64 support #2765
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Amanieu (or someone else) soon. Please see the contribution instructions for more information. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Once you have added a loongarch target in rustc, you'll want to add it to ci/build.sh
under RUST_LINUX_NO_CORE_TARGETS
so that the target is tested in libc CI.
@@ -115,6 +117,9 @@ cfg_if! { | |||
} else if #[cfg(any(target_arch = "riscv64"))] { | |||
mod riscv64; | |||
pub use self::riscv64::*; | |||
} else if #[cfg(any(target_arch = "loongarch64"))] { | |||
mod loongarch64; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you forget to commit loongarch64/mod.rs
?
faf158e
to
b409b73
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. The CI changes should be added after the target has been added to rustc.
ci/build.sh
Outdated
@@ -140,6 +140,7 @@ aarch64-fuchsia \ | |||
armv5te-unknown-linux-gnueabi \ | |||
armv5te-unknown-linux-musleabi \ | |||
i686-pc-windows-gnu \ | |||
loongarch64-unknown-linux-gnu \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be removed: it will cause CI to fail since the target hasn't been added to rustc yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a. I have removed loongarch64-unknown-linux-gnu in ci/build.rs.
b. Added loongarch64 support in libc-test and completed the test locally. But for libc-test is it better to submit a PR separately?
See the test result: zhaixiaojuan@467c34c
c. Adjusted the loongarch64/mod.rs file according to the test of libc-test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should add it in a separate PR once loongarch64-unknown-linux-gnu is available on nightly rust.
@bors r+ |
📌 Commit 467c34c has been approved by |
☀️ Test successful - checks-actions, checks-cirrus-freebsd-11, checks-cirrus-freebsd-12, checks-cirrus-freebsd-13 |
Holy moly, I didn't even know the existence of Loongson's porting efforts until I was kindly pointed to rust-lang/rust#96971, by @xry111, knowing that such effort cannot begin before the kernel/libc ABI freeze... next time surely CC me ;-) |
Some questions:
|
Definitely. It's unlikely LoongArch would ever become bi-endian, byteswapping is so cheap with dedicated
Definitely too, we don't want to ever see |
The LoongArch architecture (LoongArch) is an Instruction Set
Architecture (ISA) that has a Reduced Instruction Set Computer (RISC)
style.
The documents are on:
https://loongson.github.io/LoongArch-Documentation/README-EN.html
https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html