This topic is about supporting the creation of binaries that do the following:
$ ldd binary not a dynamic executable
I managed to do this after reading this post, but it requires:
- compiling all crate deps with
cargo build -p
--emit-objargument with the new
cargo rustccomand to a) get a .o file and b) get a linker command
- hand editing the linker command line to (among other things) add
This resulted in a binary (with glibc statically linked) that I can run anywhere, even without libc installed. Static linking is one of the selling points of go and I think making this easier is worth pursuing with rust. Compiling on old distros for maximum compatibility isn’t fun.
So it seems I may not understand the blocker. Given I do have a working statically linked binary, why is glibc not suitable for static linking? There are some issues (see the performance issue outlined in my first link and this comment chain) but it does result in functional output.