Skip to content

std doesn't compile for riscv32gc-unknown-linux-gnu #164694

Closed

Description

@newpavlov

One of the recent Nightly updates has broken std for riscv32gc-unknown-linux-gnu. Using -Z build-std results in the following compilation errors:

error[E0425]: cannot find value `SYS_futex` in crate `libc`
   --> /home/newpavlov/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/sync/futex/unix.rs:64:31
    |
 64 |                         libc::SYS_futex,
    |                               ^^^^^^^^^ not found in `libc`
    |
note: similarly named constant `SYS_fstat` defined here
   --> /home/newpavlov/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libc-0.2.191/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs:446:1
    |
446 | pub const SYS_fstat: c_long = 80;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: a constant with a similar name exists
    |
 64 -                         libc::SYS_futex,
 64 +                         libc::SYS_fstat,
    |

error[E0425]: cannot find value `SYS_futex` in crate `libc`
   --> /home/newpavlov/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/sync/futex/unix.rs:97:34
    |
 97 |     unsafe { libc::syscall(libc::SYS_futex, ptr, op, 1) > 0 }
    |                                  ^^^^^^^^^ not found in `libc`
    |
note: similarly named constant `SYS_fstat` defined here
   --> /home/newpavlov/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libc-0.2.191/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs:446:1
    |
446 | pub const SYS_fstat: c_long = 80;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: a constant with a similar name exists
    |
 97 -     unsafe { libc::syscall(libc::SYS_futex, ptr, op, 1) > 0 }
 97 +     unsafe { libc::syscall(libc::SYS_fstat, ptr, op, 1) > 0 }
    |

error[E0425]: cannot find value `SYS_futex` in crate `libc`
   --> /home/newpavlov/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/sync/futex/unix.rs:106:29
    |
106 |         libc::syscall(libc::SYS_futex, ptr, op, i32::MAX);
    |                             ^^^^^^^^^ not found in `libc`
    |
note: similarly named constant `SYS_fstat` defined here
   --> /home/newpavlov/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libc-0.2.191/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs:446:1
    |
446 | pub const SYS_fstat: c_long = 80;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: a constant with a similar name exists
    |
106 -         libc::syscall(libc::SYS_futex, ptr, op, i32::MAX);
106 +         libc::syscall(libc::SYS_fstat, ptr, op, i32::MAX);
    |

Previously there was a similar issue: #143440

Activity

  1. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Oct 21, 2026
  2. added
    O-riscvTarget: RISC-V architecture
    -Zbuild-stdUnstable cargo option: -Zbuild-std
    and removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Oct 21, 2026
  3. maya-qorsa commented on Oct 22, 2026

    @maya-qorsa

    @rustbot claim

    EDIT: whoops meant to do this with my personal account @TechnoPorg so I'm not interacting on here with multiple accounts

  4. tgross35 commented on Oct 22, 2026

    @tgross35
    Member

    Fyi this target has no maintainers, if somebody is building on the regular than it could use some help...

  5. added a commit that references this issue on Oct 22, 2026
    4b7d0fe
  6. added 2 commits that reference this issue on Oct 23, 2026
    930bf08
    25f4105
  7. added a commit that references this issue on Oct 23, 2026
    0ad4612
  8. added a commit that references this issue on Oct 23, 2026
  9. added a commit that references this issue on Oct 23, 2026
    23586b2
  10. added a commit that references this issue on Oct 24, 2026
    3b4de1d
  11. added a commit that references this issue on Oct 24, 2026
    edc09b5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

-Zbuild-stdUnstable cargo option: -Zbuild-stdC-bugCategory: This is a bug.O-riscvTarget: RISC-V architecture

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions