Comment

Comment by fwsgonzo

Last time I tried to cross compile RISC-V with Rust it just didn't work at all. I even know how linkers work and tried my best with custom linker scripts and arguments, but the toolchain would not build a rv64gc. Perhaps they have fixed the issues now, though.

I would like to add that Zig is extremely cross-compilable. You can even use it to cross compile C/C++ projects.

And Nim is fairly easy to cross compile. Just output C or C++ and cross compile that. I don't know why people are saying that cross compiling C or C++ is so miserable. Yes, it's not always a one-liner, but that depends on the toolchain. For example, there is crosstool-ng. Also Linux distros tend to have cross compilers for many architectures right on the box these days.

Here is how to cross-compile to 64-bit RISC-V on my Ubuntu machine:

    sudo apt install gcc-10-riscv64-linux-gnu g++-10-riscv64-linux-gnu

Debugging RISC-V and a heap of other architectures:

    sudo apt install gdb-multiarch
parent fwsgonzo 4 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton