I can't find info does golang depend on c runtime? If it's depend on it is it's statically compiled in go-binary to make Go-app work everywhere without dependences?
Here is topic about what C-runtime is
I can't find info does golang depend on c runtime? If it's depend on it is it's statically compiled in go-binary to make Go-app work everywhere without dependences?
Here is topic about what C-runtime is
If you're talking about executable files provided by a Go compiler, then the answer is "yes or no—it depends":
In most cases, the resulting executable program does not depend on a C run-time library.
However, on some platforms under certain circumstances the C runtime library gets dynamically linked in.
In particular, this was the case with Go versions < 1.5 on Linux when DNS resolution was used: the runtime depended on the platform's libc
implementation to handle such resolution.
In 1.5 this has been reworked.
Another possible case is (IIRC) Solaris which provides no stable way to access the kernel's syscalls directly and requires routing these calls through the platform's libc
.
There is another case: using cgo
which is a layer to interface Go code with foreign C code. Using cgo
makes your Go program depend on the C runtime. Note that you might not use cgo
directly but one or more of the third-party packages you might be using can use cgo
, and—transitively—your program ends up depending on the C runtime library.