News for hackers. Stuff that matters.
Re:Why are my Go executable files so large? by saagarjha on Monday December 30, 2019 @02:54AM (#21911585)
Why? I see no reason you couldn’t on platforms with a stable syscall ABI, other than the standard reasons against static linking.
Re:Why are my Go executable files so large? by thu2111 on Monday December 30, 2019 @04:49AM (#21912192)
It depends on the libc.

glibc doesn't really "want" to be statically linked. It can be done sometimes, depending on how it's used, the phase of the moon and so on, but breaks from time to time until it's repaired.

Some of the issues are fundamental. For instance the dynamic linker is a part of the C libraries. If you statically link libc and then dynamically load another shared library, you can end up with two copies of the C libraries loaded at once.

The C library expects various external files to be found on disk, in a format that isn't totally forwards/backwards compatible. That's reasonable when things are dynamically linked because the linker and C library abstract the developer from format changes. If you statically link you should really statically link the data files too, but the C toolchain has no provision for that.

Re:Why are my Go executable files so large? by pjmlp on Monday December 30, 2019 @08:02AM (#21913061)
The ISO C standard library has no such expectations regarding external files.