3 ms·
There are two types of "static linking" being discussed: * Linking with system libraries (what GP mentioned). * Linking with Go packages (what you're talki
by cyphar 6y ago
There are two types of "static linking" being discussed:
* Linking with system libraries (what GP mentioned).
* Linking with Go packages (what you're talking about).
Yes, Go doesn't really support -buildmode=shared anymore (and it was pretty broken from the outset). But this is a separate question to whether a Go binary is actually a static object. In most cases (and by default), Go binaries are dynamically linked to system libraries (with Go packages being statically linked into the program).
- pabs3 6y agopjmlp's comment seemed to be about Go packages to me, not system libraries.
- cyphar 6y agoThe original comment[1] spoke about "statically linked binaries" which has a pretty specific meaning ("file" says its a static binary). There are similar issues for Debian packaging if you had a hypothetical language which required you to vendor your dependencies because maintenance for security issues would be annoying (Debian worked around this problem in Go through "de-vendoring" and Go modules -- in theory -- mostly solve this issue today). But static binaries are generally not distributed in distributions because they make make core library updates worse in terms of download size as well as inflating memory usage due to lack of page-cache sharing. [1]: https://news.ycombinator.com/item?id=23773480 https://news.ycombinator.com/item?id=23773480