linux: fix unusable riscv32 GNU syscall numbers - #5455
Conversation
RISC-V 32-bit only provides time64 variants for these syscalls. Use the time64 syscall numbers and remove the generic names that refer to unavailable time32 syscalls. Sources: https://github.com/torvalds/linux/blob/v7.1/arch/riscv/kernel/Makefile.syscalls https://github.com/torvalds/linux/blob/v7.1/include/uapi/asm-generic/unistd.h#L269 https://github.com/bminor/glibc/blob/glibc-2.42/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h#L64-L68 Closes rust-lang#5379
This comment has been minimized.
This comment has been minimized.
f2e3ed9 to
6d8d553
Compare
This comment has been minimized.
This comment has been minimized.
|
|
||
| // Plain syscalls aliased to their time64 variants | ||
| pub const SYS_clock_gettime: c_long = SYS_clock_gettime64; | ||
| pub const SYS_clock_settime: c_long = SYS_clock_settime64; | ||
| pub const SYS_clock_adjtime: c_long = SYS_clock_adjtime64; | ||
| pub const SYS_clock_getres: c_long = SYS_clock_getres_time64; | ||
| pub const SYS_clock_nanosleep: c_long = SYS_clock_nanosleep_time64; | ||
| pub const SYS_timer_gettime: c_long = SYS_timer_gettime64; | ||
| pub const SYS_timer_settime: c_long = SYS_timer_settime64; | ||
| pub const SYS_timerfd_gettime: c_long = SYS_timerfd_gettime64; | ||
| pub const SYS_timerfd_settime: c_long = SYS_timerfd_settime64; | ||
| pub const SYS_utimensat: c_long = SYS_utimensat_time64; | ||
| pub const SYS_pselect6: c_long = SYS_pselect6_time64; | ||
| pub const SYS_ppoll: c_long = SYS_ppoll_time64; | ||
| pub const SYS_recvmmsg: c_long = SYS_recvmmsg_time64; | ||
| pub const SYS_mq_timedsend: c_long = SYS_mq_timedsend_time64; | ||
| pub const SYS_mq_timedreceive: c_long = SYS_mq_timedreceive_time64; | ||
| pub const SYS_rt_sigtimedwait: c_long = SYS_rt_sigtimedwait_time64; | ||
| pub const SYS_futex: c_long = SYS_futex_time64; | ||
| pub const SYS_sched_rr_get_interval: c_long = SYS_sched_rr_get_interval_time64; |
There was a problem hiding this comment.
Could you preserve the existing ordering?
There was a problem hiding this comment.
Thanks, updated. The generic names are now removed rather than aliased, and the *_time64 constants stay in their original positions. I also rebased onto the latest main. (^^;
|
Reminder, once the PR becomes ready for a review, use |
6d8d553 to
4fe2850
Compare
|
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. |
|
@rustbot ready |
|
Are you developing for this platform? I would love to have some downstream CI, rv32-linux is very breakage prone because it's the one target that is 64-bit time_t by default at a time when we're trying to get our ducks in a row with that. See #5209 for instructions if you might be able to set something up |
|
Thanks! I'm not currently developing on rv32 Linux, so I don't have a downstream environment I can reliably maintain. |
|
For what it's worth, if you're able to run the target in docker+qemu that's enough. We just can't do that in this repo because of the target tier policy |
RISC-V 32-bit only provides time64 variants for these syscalls. Use the time64 syscall numbers and remove the generic names that refer to unavailable time32 syscalls. Sources: https://github.com/torvalds/linux/blob/v7.1/arch/riscv/kernel/Makefile.syscalls https://github.com/torvalds/linux/blob/v7.1/include/uapi/asm-generic/unistd.h#L269 https://github.com/bminor/glibc/blob/glibc-2.42/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h#L64-L68 Closes rust-lang#5379 (backport <rust-lang#5455>) (cherry picked from commit 181ab01)
Description
Fix the syscall definitions for
riscv32gc-unknown-linux-gnu.RISC-V 32-bit does not provide the old time32 syscall implementations. This updates the GNU riscv32 module to use the corresponding time64 syscall numbers and removes the generic names that refer to unavailable time32 syscalls.
Closes #5379
Sources
Tests
cargo +nightly-2026-08-23 test --workspacepython3 ci/verify-build.py --toolchain nightly-2026-08-23 --only riscv32gc-unknown-linux-gnucargo +nightly-2026-08-23 fmt --checkgit diff --check