4 ms·
Does this mean we could have a single binary for x86_64 linux instead of two (glibc and musl)? x86_64-unknown-linux-gnu x86_64-unknown-linux-musl
by styfle 5y ago
Does this mean we could have a single binary for x86_64 linux instead of two (glibc and musl)?
x86_64-unknown-linux-gnu
x86_64-unknown-linux-musl
- sanxiyn 5y agoNo, it means there will be three binaries instead of two. Note that statically linked musl binaries run fine on glibc Linux, so you can just distribute musl binaries. That works right now. In the future, you will just distribute Rustix binaries, which will be hopefully smaller than musl binaries (because it doesn't need to support C API).
- CodesInChaos 5y agoI expect 4 options: * glibc linked dynamically * musl linked dynamically * musl linked statically * direct syscalls from rust and possibly additional options choosing if math functions, memcpy, etc. should use an implementation shipped with rust or one shipped with libc. The big question is if we'll get to a point where almost all rust application don't use a libc at all.
- masklinn 5y ago> * musl linked dynamically > * musl linked statically This is handled through the orthogonal "crt-static" target-feature. IIRC each supported CRT has a preference, but for some that can be overridden (musl would be one of those, possibly one of few of those since statically linking glibc is generally recommended against, and so's pretty much every non-linux libc, when that's an option at all).