Add support for loongarch64#528
Conversation
114726d to
4b3f3d1
Compare
364706e to
6d98f02
Compare
xen0n
left a comment
There was a problem hiding this comment.
Now I see why rust-lang/rust#101069 is needed at all at such an early bring-up stage... this crate is being depended upon by Cargo. A lot have changed since I last ported Rust.
cc @heiher
| #[cfg(target_arch = "mips64")] | ||
| let ptr = vdso.sym(cstr!("LINUX_2.6"), cstr!("__vdso_clock_gettime")); | ||
| #[cfg(target_arch = "loongarch64")] | ||
| let ptr = vdso.sym(cstr!("LINUX_5.19"), cstr!("__vdso_clock_gettime")); |
There was a problem hiding this comment.
This is wrong, LoongArch vDSO symbol version is LINUX_5.10 according to the sources. (It's the version at the time LoongArch upstream work has started, not the time when the port was mainlined, IIUC.)
| } | ||
| } | ||
|
|
||
| #[cfg(not(target_arch = "loongarch64"))] |
There was a problem hiding this comment.
I don't think we should deprive LoongArch from having old-style {get,set}rlimit API support. As you can see, this function is actually just a prlimit64 wrapper.
| #[cfg(all(target_pointer_width = "64", not(target_arch = "mips64")))] | ||
| #[cfg(all( | ||
| target_pointer_width = "64", | ||
| not(any(target_arch = "mips64", target_arch = "loongarch64")) |
There was a problem hiding this comment.
Similarly we most definitely don't want to force everyone to migrate to statx if they ever want their code to run on LoongArch systems. We should keep the generic stat definitions here, but add code for translating between the two ABIs: see my Go adaptation a while ago (check src/syscall/syscall_linux_loong64.go) or glibc (check sysdeps/unix/sysv/linux/fstatat64.c). We have to add the code because we're the first 64-bit architecture without fstat at all.
On architectures it doesn't recognize, rustix should default to using its libc backend, which doesn't use any |
The LoongArch architecture (LoongArch) is an Instruction Set Architecture (ISA) that has a RISC style.
Documentations:
ISA:
https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html
ABI:
https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html
More docs can be found at:
https://loongson.github.io/LoongArch-Documentation/README-EN.html