Jump to navigation Jump to search
Installing Go with pacman might cause some permission problems. For example,
$ go install -tags netgo -ldflags="-s -w" go install net: open /usr/lib/go/pkg/linux_amd64/net.a: permission denied $
Managing Go packages
gccgo vs gc
gccgo compiler (from ) is usually slower to compile but generally has more optimizations than the
gc compiler (from ).
- The Go language has always been defined by a spec, not an implementation. The Go team has written two different compilers that implement that spec: gc and gccgo.
- Gc is the original compiler, and the go tool uses it by default.
- Gccgo is a different implementation with a different focus
- Compared to gc, gccgo is slower to compile code but supports more powerful optimizations, so a CPU-bound program built by gccgo will usually run faster.
- The gc compiler supports only the most popular processors: x86 (32-bit and 64-bit) and ARM.
- Gccgo, however, supports all the processors that GCC supports.
- Not all those processors have been thoroughly tested for gccgo, but many have, including x86 (32-bit and 64-bit), SPARC, MIPS, PowerPC and even Alpha.
- Gccgo has also been tested on operating systems that the gc compiler does not support, notably Solaris.
- Recent 2019 benchmarks appear to show that gc has improved more quickly than gccgo has (probably because it's received more attention), so even though gccgo has made significant improvements, gc seems like the better choice in most circumstances: https://meltware.com/2019/01/16/gccgo-benchmarks-2019.html Skyfaller (talk) 12:52, 11 April 2020 (UTC)