3 ms·
> Static linking is always an option. Not if you use C and glibc (most common combination of them all, most software requires glibc). Even if you compile glibc
by 4ad 14y ago
> Static linking is always an option.
Not if you use C and glibc (most common combination of them all, most software requires glibc). Even if you compile glibc statically in your program (not an option by default at least in Ubuntu), glibc itself will load more shared objects at runtime.
- TazeTSchnitzel 14y agoOh, huh, I didn't know about that.
- yorhel 14y agoI've had very positive experiences with statically linking against musl[1], As long as your code and the required libraries don't use dlopen() tricks (e.g. as glib GIO does), you can quite reliably create a single statically linked binary for your program. Admittedly, this isn't as easy to setup as Go is. [1] http://www.etalabs.net/musl/ http://www.etalabs.net/musl/
- tedunangst 14y agoYou can statically link if you also compile a static glibc with modules disabled. But it's a pita and you can still have kernel compat problems.