Re:Things I Learned Writing a JIT in Go
by stock_toaster on Thursday May 01, 2014 @02:27AM
(#7678555)
> Afaik, in this case it's 'net/http' that pulls in a
> dependency on cgo (again, unless we rebuild the whole
> go toolchain with cgo_enabled=0).
You can also build with '-tags netgo'[1], and use go for name resolution, but still use cgo for when else you may need it.Indeed:
go install -a -tags netgo std
go build -tags netgo
ldd wipes.git
not a dynamic executable
Thanks for the tip :)
Eg:
Afaik, in this case it's 'net/http' that pulls in a dependency on cgo (again, unless we rebuild the whole go toolchain with cgo_enabled=0).Not that this is terrible as such, but it's a gotcha if you want to run the resulting binary in a chroot, or on a host with a different version of libc...