I've been experimenting with compilation for arm/arm64 on Ubuntu 20.04.
I've installed the (supposedly) needed packages and I'm good to go.
Here's my config.nims configuration:
arm.linux.gcc.path = "/usr/bin"
arm.linux.gcc.exe = "arm-linux-gnueabi-gcc"
arm.linux.gcc.linkerexe = "arm-linux-gnueabi-gcc"
arm64.linux.gcc.path = "/usr/bin"
arm64.linux.gcc.exe = "aarch64-linux-gnu-gcc"
arm64.linux.gcc.linkerexe = "aarch64-linux-gnu-gcc"
When I pass the compiler --cpu:arm --os:linux, suddenly existing header files (namely gmp.h) cannot be found - so I guess there's something wrong with where arm-linux-gnueabi-gcc is looking for the header.
The main problem is with --cpu:arm64 --os:linux, in that case... the compiler seems to be using gcc and not aarch64-linux-gnu-gcc.
What is going on?
Now, the only remaining thing is the missing header:
/root/arturo/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc -c -w -fmax-errors=3 '-O3' -Os -fno-ident -I/root/.choosenim/toolchains/nim-1.4.4/lib -I/root/arturo/src/extras -I/root/arturo/src -o /root/arturo/.cache/stdlib_iterators.nim.c.o /root/arturo/.cache/stdlib_iterators.nim.c [Exec]
/root/arturo/.cache/stdlib_iterators.nim.c:13:10: fatal error: gmp.h: No such file or directory
13 | #include <gmp.h>
| ^~~~~~~
The very same program - with cross-compiling to arm - works fine.
I'm now trying to compile it all from scratch in an Alpine arm64 build.