I just tried building using

mero@hix ~/go/src$ CGO_ENABLED=0 ./make.bash
mero@hix ~/go/src$ file ../bin/go
../bin/go: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically
linked, Go
BuildID=vuwQ_gWzFYzm9u1fSb6J/teB52WVS50es5tAa1xez/9HCuFMUtERd7wPEheIgP/i3RObo0pxXnfqkowogAH,
not stripped

I'm honestly quite surprised this works.

On Wed, Jan 20, 2021 at 5:28 PM Hongyi Zhao <hongyi.z...@gmail.com> wrote:

> On Ubuntu 20.10, I use the following steps to build the go binary:
> $ sudo apt-get build-dep -y golang
> $ git clone https://github.com/golang/go.git go.git
> $ cd go.git/src
> $ ./make.bash
> $ cd ../
> $ ldd bin/go
> linux-vdso.so.1 (0x00007ffef27ee000) libpthread.so.0 =>
> /lib/x86_64-linux-gnu/libpthread.so.0
> (0x00007f540e41d000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6
> (0x00007f540e233000) /lib64/ld-linux-x86-64.so.2 (0x00007f540e475000)
>
> It seems that it needs some distribution relevant dependencies for working
> correctly. Thus, I want to know whether I can build a totally static go
> binary so that it can run under other Linux distributions.
>
> Regards,
> HY
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/d496885c-63ad-4efe-901c-fb4b198bdf84n%40googlegroups.com
> <https://groups.google.com/d/msgid/golang-nuts/d496885c-63ad-4efe-901c-fb4b198bdf84n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAEkBMfGAZTp0TneOJwcjv_GQ85dTiq%2BFeCYYR-3Mcx%3D-Upr-Xg%40mail.gmail.com.

Reply via email to