What is the difference between -static
and -static-libgo
for gccgo
? The documentation doesn't seem to really shed light on what is going on:
- Use the
-static-libgo
option to link statically against the compiled packages. - Use the
-static
option to do a fully static link (the default for the gc compiler).
Is -static-libgo
only static linking libgo.a
only? While -static
is full glibc library?
Check the dynamic linkage in the generated ELFs:
gc builds statically:
gccgo links dynamically against libgo, libc etc. by default:
Bake libgo inside the executable, but still link dynamically to libc and friends:
Link everything statically: