Re:151-byte static Linux binary in Rust
by steveklabnik on Sunday January 11, 2015 @01:59PM
(#8870849)
You can't static link glibc, so our static binaries still have a dynamic dependency on it.
[ Parent
| on HN ]
Is there a process for making a fully static binary (say if I were to substitute an alternate libc, or provide my own low level wrappers for syscalls, or whatnot)?
Re:151-byte static Linux binary in Rust
by steveklabnik on Sunday January 11, 2015 @03:00PM
(#8871059)
Yes, that's totally possible. You can write a kernel in Rust if you want.
...is it documented anywhere? where?
Re:151-byte static Linux binary in Rust
by steveklabnik on Sunday January 11, 2015 @06:59PM
(#8871839)
http://doc.rust-lang.org/book/unsafe.html#avoiding-the-stand... is the closest we have, currently. https://github.com/rust-lang/rust/wiki/Operating-system-deve... has a bunch of stuff, and https://github.com/charliesome/rustboot and its forks are examples that I know of.
The example minimal do-nothing program there is much smaller (8k), but still results in a dynamic binary requiring glibc.
The only unresolved symbol is: __libc_start_main@@GLIBC_2.2.5
Re:151-byte static Linux binary in Rust
by daurnimator on Sunday January 11, 2015 @04:29PM
(#8871398)
I believe musl supports static linking
Any reason one couldn't use musl instead for static linking? (http://www.musl-libc.org/)
Re:151-byte static Linux binary in Rust
by cowsandmilk on Sunday January 11, 2015 @02:24PM
(#8870942)
and for many, there are legal issues with statically linking glibc due to its license.