Repository navigation
linux: add SYS_futex for riscv32 GNU - #5631
jadhavgaurav wants to merge 1 commit into
Conversation
This comment has been minimized.
This comment has been minimized.
riscv32 has no time32 futex syscall, so SYS_futex was removed along with the other time32 numbers. Alias it to SYS_futex_time64, the same way the riscv32 musl module does, so that users such as parking_lot_core that use SYS_futex keep building. time_t is 64-bit on this target, so the time64 syscall takes the same timespec layout. Fixes rust-lang#5627 Sources: - https://github.com/torvalds/linux/blob/v7.1/include/uapi/asm-generic/unistd.h - https://github.com/bminor/glibc/blob/glibc-2.42/sysdeps/unix/sysv/linux/riscv/rv32/arch-syscall.h Signed-off-by: Gaurav Jadhav <gaurav.vjadhav01@gmail.com>
99b5186 to
c2fcaca
Compare
|
The links you posted don't back this change up. https://github.com/torvalds/linux/blob/8cd9520d35a6c38db6567e97dd93b1f11f185dc6/include/uapi/asm-generic/unistd.h#L269-L272 is gated behind |
|
@rustbot author for feedback |
|
Reminder, once the PR becomes ready for a review, use |
|
Thanks, you are right. The glibc rv32 arch-syscall.h I cited only defines __NR_futex_time64 (422) and has no __NR_futex, and in Linux's asm-generic unistd.h __NR_futex is gated behind __ARCH_WANT_TIME32_SYSCALLS, which rv32 does not set. The SYS_futex alias exists in musl's own headers, but the gnu module follows glibc, so the alias is not backed there. Closing this one. Sorry for the noise. |
Description
Add
SYS_futexforriscv32gc-unknown-linux-gnuas an alias ofSYS_futex_time64, matching the riscv32 musl module. #5455 removed the time32SYS_futex = 98, which does not exist on riscv32; this does not bring that number back.parking_lot_coreuseslibc::SYS_futexand no longer builds on this target. time_t is 64-bit on riscv32, so the time64 syscall is the one aSYS_futexcaller needs.Fixes #5627
Checklist
libc-test/semverhave been updated (SYS_futexis already listed inlinux.txt, no change needed)*LASTor*MAXhave the standard doc comment (not applicable)cargo test -p libc-test --target mytarget): not run, onlycargo check -Zbuild-std=core --target riscv32gc-unknown-linux-gnuandcargo fmt --checkon nightly@rustbot label +stable-nominated