Skip to content

Port the Linux standard-library syscall layer to RV64 #370

Closed

Description

@LunaStev

Roadmap context

Wave can now discover an RV64 Linux sysroot, link a hosted program, and execute it under qemu-user. The raw Linux standard-library syscall layer is still tied to x86-64 register assignments and syscall numbers.

Scope

  • Split architecture-specific Linux syscall implementations from the common std API.
  • Preserve common modules under std/sys/linux/ without leaking x86-64 registers or numbers.
  • Implement RV64 syscall0 through syscall6 according to the Linux RISC-V ABI.
  • Dispatch by the compiler's target architecture contract.
  • Validate process, memory, file, time, socket, tty, and environment paths.
  • Keep libc bindings isolated under std/libc/.

Completion criteria

  • Core std behavior has equivalent x86-64 and RV64 tests.
  • RV64 file, memory, process, time, and socket smoke tests execute under qemu-user.
  • Syscall numbers and register mappings are source-auditable.
  • Unsupported Linux architectures fail clearly.
  • No x86-64 syscall detail remains in the common Linux layer.

This is a tracking implementation issue, not a newcomer-sized task. Small syscall-table and test-fixture pieces may be split out.

Activity

  1. added
    enhancement
    help wanted
    os support
    cross-platform
    on Aug 25, 2026
  2. LunaStev commented on Aug 29, 2026

    @LunaStev
    MemberAuthor

    Completed by #422.

    The merged standard-library foundation now includes:

    • a Linux RV64 std::sys provider split from the common Linux layer;
    • RV64 syscall wrappers and architecture-specific filesystem, process, memory, time, socket, TTY, and environment routing;
    • hosted Linux RV64 cross-compilation and QEMU execution coverage;
    • source-contract and native example coverage integrated into CI.

    Remaining freestanding startup work stays tracked separately in #371, and the broader target/runtime documentation remains in #372.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    cross-platformenhancementhelp wantedos support

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions