←back to thread

201 points generichuman | 1 comments | | HN request time: 1.484s | source
Show context
Jeaye ◴[] No.43552616[source]
I don't understand why they don't just statically link their binaries. First, they said this:

> Even if you managed to statically link GLIBC—or used an alternative like musl—your application would be unable to load any dynamic libraries at runtime.

But then they immediately said they actually statically link all of their deps aside from libc.

> Instead, we take a different approach: statically linking everything we can.

If they're statically linking everything other than libc, then using musl or statically linking glibc will finish the job. Unless they have some need for loading share libs at runtime which they didn't already have linked into their binary (i.e. manual dlopen), this solves the portability problem on Linux.

What am I missing (assuming I know of the security implications of statically linked binaries -- which they didn't mention as a concern)?

replies(6): >>43552647 #>>43552652 #>>43552691 #>>43552703 #>>43552800 #>>43552822 #
masfuerte ◴[] No.43552647[source]
Various things including name (DNS) resolution rely on dynamic linking.
replies(1): >>43552651 #
Jeaye ◴[] No.43552651[source]
Are you saying that a statically linked binary cannot make an HTTP request to `google.com` because it would be unable to resolve the domain name?

There are entire distros, like alpine, built on musl. I find this very hard to believe.

replies(4): >>43552683 #>>43552699 #>>43552733 #>>43555012 #
1. thyristan ◴[] No.43555012[source]
The easy and conforming way to do that would be to call "getent hosts google.com" and use the answer. But this only works for simple use cases where you just need some IPv4/IPv6 address, you can't get other kinds of DNS records like MX or TLSA this way.