Repository navigation
Use 64-bit futex syscalls on RV32 Linux - #164748
Conversation
|
cc @rust-lang/miri These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
|
|
This comment has been minimized.
This comment has been minimized.
| // riscv32 uses a 64-bit `libc::timespec`, and only exposes the `SYS_futex_time64` syscall, | ||
| // whereas other 32-bit targets use their 32-bit `libc::timespec` with `SYS_futex`, and require | ||
| // opting into a 64-bit `timespec` with the `SYS_futex_time64` syscall. | ||
| target_arch = "riscv32" => { | ||
| use libc::SYS_futex_time64 as SYS_futex; | ||
| } | ||
| _ => { | ||
| use libc::SYS_futex; | ||
| } |
There was a problem hiding this comment.
This is a rather confusing comment, can it be simplified?
There was a problem hiding this comment.
I wanted to clarify that the libc::timespec struct is ABI-compatible with the syscall that gets selected by this cfg_select!, since that tripped me up. I removed the timespec parts but if you have better wording suggestions I'm happy to implement them.
|
Reminder, once the PR becomes ready for a review, use |
|
Actually, why are Miri changes needed at all for the std fix? We aren't running tests against rv32 in this repo as far as I'm aware |
I just grepped for SYS_futex with the intent of fixing everywhere it was used. But it seems the Miri changes would be more involved than I thought, so maybe instead I'll just file the lack of SYS_futex_time64 support as a Miri issue for now. |
This comment has been minimized.
This comment has been minimized.
|
rv32 is not a supported Miri target currently. I am not even sure if we test 64bit riscv....
|
13eac20 to
c860e0d
Compare
|
I've gotten rid of my ill-fated Miri changes and if they happen at all, they can happen in a separate PR to the
Does Miri support any 32-bit Linux targets? If not the |
Atleast i686 and arm32 are https://github.com/rust-lang/miri/blob/eaacf5fb522e50f25aa0b12db34bc99c0bd38068/ci/ci.sh#L159-L191 |
|
Turns out we do check riscv64a23-unknown-linux-gnu in CI. But officially we only support tier 1 targets, and then we check some tier 2 targets but that's best-effort and will be disabled if a fix would be too much work and block other work. So yes we do support i686-linux. |
Use 64-bit futex syscalls on RV32 Linux Closes rust-lang#164694 This changes riscv32 Linux targets to use the `SYS_futex_time64` syscall instead of `SYS_futex` in the standard library to fix compilation after rust-lang/libc#5455. `libc::timespec` has a `c_long` for nanoseconds on 32-bit targets right now, whereas the kernel uses `long long`. I'm not sure whether this is a problem or not? I'm also curious whether using the time64 syscall on _all_ 32-bit targets is a desired change. r? tgross35
Use 64-bit futex syscalls on RV32 Linux Closes rust-lang#164694 This changes riscv32 Linux targets to use the `SYS_futex_time64` syscall instead of `SYS_futex` in the standard library to fix compilation after rust-lang/libc#5455. `libc::timespec` has a `c_long` for nanoseconds on 32-bit targets right now, whereas the kernel uses `long long`. I'm not sure whether this is a problem or not? I'm also curious whether using the time64 syscall on _all_ 32-bit targets is a desired change. r? tgross35
…uwer Rollup of 5 pull requests Successful merges: - #164748 (Use 64-bit futex syscalls on RV32 Linux) - #159689 (Account for missing turbofish in resolve errors) - #164733 (Include `deprecated` attributes in `rustc_resolve` intra-doc link resolution) - #164754 (Update outdated/incorrect unstable tracking issue links) - #164761 ([tiny] Properly format return type in lifetime error with backticks)
This comment has been minimized.
This comment has been minimized.
Use 64-bit futex syscalls on RV32 Linux Closes #164694 This changes riscv32 Linux targets to use the `SYS_futex_time64` syscall instead of `SYS_futex` in the standard library to fix compilation after rust-lang/libc#5455. `libc::timespec` has a `c_long` for nanoseconds on 32-bit targets right now, whereas the kernel uses `long long`. I'm not sure whether this is a problem or not? I'm also curious whether using the time64 syscall on _all_ 32-bit targets is a desired change. r? tgross35
This comment has been minimized.
This comment has been minimized.
|
💔 Test for 0ad4612 failed: CI. Failed job:
|
|
💔 I suspect this PR failed tests as part of a rollup After fixing the problem, consider running a try job for the failed job before re-approving. Link to failure: #164780 (comment) |
|
This PR was contained in a rollup (#164780), which was unapproved. |
|
rustix <1.1.5 is incompatible with libc >=0.2.190 (bytecodealliance/rustix#1676), so I've bumped it in the lockfile as well. If someone with try build permissions could run the failed job again to see if this fixes it, that would be appreciated. |
|
@bors try jobs=dist-powerpc64-linux-musl |
Use 64-bit futex syscalls on RV32 Linux try-job: dist-powerpc64-linux-musl
This comment has been minimized.
This comment has been minimized.
|
@rustbot ready |
|
@bors r+ |
…uwer Rollup of 5 pull requests Successful merges: - #163766 (Outline constant messages from panicking macros) - #147368 (Add extra `unchecked_disjoint_bitor` implementations.) - #164748 (Use 64-bit futex syscalls on RV32 Linux) - #164520 (powerpc: implement c-variadic correctly for softfloat targets) - #164671 (add maintainers for tier 2 riscv64 targets (baremetal only))
Rollup merge of #164748 - TechnoPorg:64-bit-futex, r=tgross35 Use 64-bit futex syscalls on RV32 Linux Closes #164694 This changes riscv32 Linux targets to use the `SYS_futex_time64` syscall instead of `SYS_futex` in the standard library to fix compilation after rust-lang/libc#5455. `libc::timespec` has a `c_long` for nanoseconds on 32-bit targets right now, whereas the kernel uses `long long`. I'm not sure whether this is a problem or not? I'm also curious whether using the time64 syscall on _all_ 32-bit targets is a desired change. r? tgross35
…uwer Rollup of 5 pull requests Successful merges: - rust-lang/rust#163766 (Outline constant messages from panicking macros) - rust-lang/rust#147368 (Add extra `unchecked_disjoint_bitor` implementations.) - rust-lang/rust#164748 (Use 64-bit futex syscalls on RV32 Linux) - rust-lang/rust#164520 (powerpc: implement c-variadic correctly for softfloat targets) - rust-lang/rust#164671 (add maintainers for tier 2 riscv64 targets (baremetal only))
View all comments
Closes #164694
This changes riscv32 Linux targets to use the
SYS_futex_time64syscall instead ofSYS_futexin the standard library to fix compilation after rust-lang/libc#5455.libc::timespechas ac_longfor nanoseconds on 32-bit targets right now, whereas the kernel useslong long. I'm not sure whether this is a problem or not?I'm also curious whether using the time64 syscall on all 32-bit targets is a desired change.
r? tgross35