Re: [go-nuts] Building a totally static go binary.

2021-01-22 Thread Brian Candler
Building statically with cgo seems to be possible, although over time I found the required flags have changed. https://github.com/prometheus/snmp_exporter/issues/223 On Thursday, 21 January 2021 at 01:37:12 UTC hongy...@gmail.com wrote: > On Thursday, January 21, 2021 at 12:38:30 AM UTC+8 > axe

Re: [go-nuts] Building a totally static go binary.

2021-01-20 Thread Hongyi Zhao
On Thursday, January 21, 2021 at 12:38:30 AM UTC+8 axel.wa...@googlemail.com wrote: > 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 > Bu

Re: [go-nuts] Building a totally static go binary.

2021-01-20 Thread Hongyi Zhao
On Thursday, January 21, 2021 at 8:27:02 AM UTC+8 Ian Lance Taylor wrote: > On Wed, Jan 20, 2021 at 8:28 AM Hongyi Zhao 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.

Re: [go-nuts] Building a totally static go binary.

2021-01-20 Thread Ian Lance Taylor
On Wed, Jan 20, 2021 at 8:28 AM Hongyi Zhao 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 (0x00

Re: [go-nuts] Building a totally static go binary.

2021-01-20 Thread 'Axel Wagner' via golang-nuts
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

[go-nuts] Building a totally static go binary.

2021-01-20 Thread Hongyi Zhao
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 (0x7ffef27ee000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread