by fwsgonzo · 4y ago · 0 comments
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-multiarchYMMV; my experience was actually the opposite, approximately an year ago. I was actually really surprised of being able to build na executable for RISC-V (that I then copied to a VM, and run) all by adding 4 lines to Cargo's config.toml.