Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
steveklabnik
on Jan 11, 2015
|
parent
|
context
|
favorite
| on:
151-byte static Linux binary in Rust
You can't static link glibc, so our static binaries still have a dynamic dependency on it.
swetland
on Jan 11, 2015
|
next
[–]
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)?
steveklabnik
on Jan 11, 2015
|
parent
|
next
[–]
Yes, that's totally possible. You can write a kernel in Rust if you want.
tdrd
on Jan 11, 2015
|
root
|
parent
|
next
[–]
...is it documented anywhere? where?
steveklabnik
on Jan 11, 2015
|
root
|
parent
|
next
[–]
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.
swetland
on Jan 12, 2015
|
root
|
parent
|
next
[–]
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
daurnimator
on Jan 11, 2015
|
parent
|
prev
|
next
[–]
I believe musl supports static linking
ChickeNES
on Jan 12, 2015
|
prev
|
next
[–]
Any reason one couldn't use musl instead for static linking? (
http://www.musl-libc.org/
)
cowsandmilk
on Jan 11, 2015
|
prev
[–]
and for many, there are legal issues with statically linking glibc due to its license.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: