Closed brsnik closed 1 year ago
Unfortunately, cargo
is not smart like zig
, and does not support cross-compilation of executables out of the box. You have to manually configure a C cross-linker and create and configure a sysroot with Linux's glibc and other C libraries. This is a general design issue with cargo build
, not cargo deb
.
This is very fiddly and annoying to do on macOS, so I suggest compiling Linux executables in Docker instead.
I'm running MacOS on Intel and getting the following error when I try to compile with targets:
aarch64-unknown-linux-gnu
,i686-unknown-linux-gnu
andx86_64-unknown-linux-gnu
.