|
|
|
|
|
by pornel
1802 days ago
|
|
That's true only for static libraries and pure-Rust projects.
For executables and dynamic libraries Rust relies on system-provided linker (except nightly that can enable lld) and target libc already present on the OS (the nice part zig has, but Rust doesn't). Rust totally craps out if you try to make a binary or dylib and you don't already have cross-compilation toolchain on your OS. It's doable from a Linux distro that has cross packages and a GNU target. It's a PITA for anything else, including anything from Windows and macOS hosts. `zig cc` is actually useful even for cross-compiling Rust projects, because some Rust crates depend on C libraries. |
|