If the go program compiled by a completely static compiled version of go binary compiler will also be static automatically? To be more specific, on Ubuntu 20.04, I've compiled the latest git master version of go compiler in a completely static manner as shown below:
$ which go | xargs file
/home/werner/Public/repo/
github.com/golang/go.git/bin/go: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=5jq4NVhOUQBZ9qoSzZZP/ZGpiMeW1vV69o1mL-B9A/6YaUKXNOw58uUviv4EeO/4sUw0l9CinylaK_Pov59, not stripped
Then I try to build the dnsproxy by the following steps:
$ cd dnsproxy.git
$ go build
$ file dnsproxy
dnsproxy: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=6mIriY-h59Wwm2_gwbk2/rXhgRt_o3oIf_KSuKKtt/BYmwRfWtoqym2xPocRBT/Z2CIkEn5HaeVqVhdwxYu, not stripped
As you can see, the compiled dnsproxy with the completely static go compiler binary will also generate a static go program. I'm not sure if this is always true. Any hints will be highly appreciated.
Regards,
HY