Skip to content

linux: fix unusable riscv32 GNU syscall numbers - #5455

Open
xjtu-ctgg wants to merge 1 commit into
rust-lang:mainfrom
xjtu-ctgg:fix-riscv32-gnu-time64-syscalls-5379
Open

linux: fix unusable riscv32 GNU syscall numbers#5455
xjtu-ctgg wants to merge 1 commit into
rust-lang:mainfrom
xjtu-ctgg:fix-riscv32-gnu-time64-syscalls-5379

Conversation

@xjtu-ctgg

@xjtu-ctgg xjtu-ctgg commented Aug 31, 2026

Copy link
Copy Markdown

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 --workspace
  • python3 ci/verify-build.py --toolchain nightly-2026-08-23 --only riscv32gc-unknown-linux-gnu
  • cargo +nightly-2026-08-23 fmt --check
  • git diff --check

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@rustbot

This comment has been minimized.

@xjtu-ctgg
xjtu-ctgg force-pushed the fix-riscv32-gnu-time64-syscalls-5379 branch from f2e3ed9 to 6d8d553 Compare August 31, 2026 16:31
@rustbot

This comment has been minimized.

@tgross35 tgross35 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.

Are the values like SYS_futex not usable at all in C? riscv32gc-unknown-linux-* are T3 so they can be removed or deprecated first rather than aliased.

View changes since this review

Comment on lines +758 to +777

// 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;

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.

Could you preserve the existing ordering?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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. (^^;

@rustbot

rustbot commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@xjtu-ctgg
xjtu-ctgg force-pushed the fix-riscv32-gnu-time64-syscalls-5379 branch from 6d8d553 to 4fe2850 Compare September 1, 2026 01:41
@rustbot

rustbot commented Sep 1, 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.

@xjtu-ctgg

Copy link
Copy Markdown
Author

@rustbot ready

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unusable syscall numbers defined for riscv32gc-unknown-linux-gnu

4 participants