zig icon indicating copy to clipboard operation
zig copied to clipboard

Tier 1 Support for riscv64-linux

Open andrewrk opened this issue 6 years ago • 5 comments

Once all these items are complete, we can say that Zig has Tier 1 support for 64-bit RISC-V Linux.

  • [x] make sure we can build-exe with -target riscv64-linux-gnu
  • [x] make sure we can build-exe with -target riscv64-linux-musl
  • [x] ability to build libc for riscv64-linux-gnu (#3340)
  • [x] ability to build libc for riscv64-linux-musl
  • [ ] make sure stack traces / debug info works & add test coverage
  • [x] add the target to the test matrix
  • [x] get the full test suite passing
  • [ ] figure out a risc-v linux continuous integration testing service and hook it up to zig's CI testing.
  • [x] hook up to update download page with risc-v tarballs

andrewrk avatar Feb 14 '20 15:02 andrewrk

zig build-exe hello.c -lc -target riscv64-linux-musl with version 0.10.0-dev.3660+4a98385b0 works.

Ivan-Velickovic avatar Aug 21 '22 07:08 Ivan-Velickovic

Looks like traces work, only needs to be added to the test coverage according to the task.

const std = @import("std");

pub fn a() !void {
    try b();
}

pub fn b() !void {
    try c();
}

pub fn c() !void {
    return error.@"I'm a cat";
}

pub fn main() !void {
    try a();
}
error: I'm a cat
/home/ross/ExpidusOS/zig/main.zig:12:5: 0x100b5b7 in c (main)
    return error.@"I'm a cat";
    ^
/home/ross/ExpidusOS/zig/main.zig:8:5: 0x100b6d9 in b (main)
    try c();
    ^
/home/ross/ExpidusOS/zig/main.zig:4:5: 0x100b71b in a (main)
    try b();
    ^
/home/ross/ExpidusOS/zig/main.zig:16:5: 0x100b75d in main (main)
    try a();
    ^

RossComputerGuy avatar Feb 04 '24 05:02 RossComputerGuy

ability to build libc for riscv64-linux-musl

This can be crossed off now:

❯ cat main.zig
const std = @import("std");
pub fn main() !void {
    std.debug.print("Hello, World!\n", .{});
}
❯ ../zig/build/debug/bin/zig build-exe main.zig -target riscv64-linux
❯ ../zig/build/debug/bin/zig build-exe main.zig -target riscv64-linux-musl -lc

figure out a risc-v linux continuous integration testing service and hook it up to zig's CI testing.

Scaleway's pricing looks quite reasonable: https://labs.scaleway.com/en/em-rv1

Issues to solve:

These are all done.

alexrp avatar Aug 01 '24 22:08 alexrp

ability to build libc for riscv64-linux-gnu

This can also be crossed off as of #20909.

alexrp avatar Aug 13 '24 22:08 alexrp

This can be crossed off as of the LLVM 19 upgrade.

alexrp avatar Sep 25 '24 21:09 alexrp

figure out a risc-v linux continuous integration testing service and hook it up to zig's CI testing.

@andrewrk @alexrp Do you need someone to donate some RISC-V physical machines to you?

We are very interested in this and would like to provide some help. Can you provide more detailed requirements?

Glavo avatar Nov 25 '24 16:11 Glavo

@Glavo hey, sorry for the super late response. Probably the most important requirement is that we need physical control over the machines that we run CI on.

alexrp avatar Apr 26 '25 20:04 alexrp