What are the primary differences between the two popular Go compilers, 'gc' and 'gccgo'? Build performance? Run-time performance? Command line options? Licensing?
I'm not looking for opinions on which is best, just a basic overview of their…
Is it possible to write in Go for iPhone?
I think following steps are required
Compile Go as ARM Mach-O binary (I expect GCCGO be able to do that)
Compile iPhone app as static library (I think it possible to rename main() -> main2(), etc)
Compile…
I'm trying to convince gccgo without success to vectorize the following snippet:
package foo
func Sum(v []float32) float32 {
var sum float32 = 0
for _, x := range v {
sum += x
}
return sum
}
I'm verifying the assembly…
I've started studying Go a couple of days ago and came by its CGO thing and the gccgo compiler. From my understanding this allows a Go program to compile using the Go compiler and compile C libraries using a C compiler and reference those libraries…
I'm having trouble compiling the git2go library on OS X to linux amd64 after upgrading go 1.4.2 to go 1.5.
I think this is about cross compiling any go app that uses C code with go 1.5.
Using CGO_ENABLED=1, I get:
$ CGO_ENABLED=1 GOOS=linux…
When trying to link with gccgo on Precise, I get this linking error:
matt@matt-1005P:~/src/gopath/src/meme$ gccgo cmd/meme/main.go -o meme
/usr/bin/ld: cannot find -lgcc_s
collect2: error: ld returned 1 exit status
There are reports of this error,…
The upcoming release of Go 1.5 comes with new buildmodes which allow for exporting Go symbols to be linked and called from C code. I've been playing around with it and got basic "Hello world" examples working, but now I'm trying to link a Go library…
I have noticed that when using go build the binary result can be in excess of 2MB; but using gccgo the binary is less than 35k.
The other issue that I noticed when using gccgo is that the produced binary isn't runnable on another linux box (missing…
Now, I have the bash code which can import the version value to the go source code in compiling time using the linker which is in the go tool. This code can run normally with GC.
go build -ldflags "-X something:something" main.go
But I am testing…
Compiling an executable with gccgo creates a dynamically linked executable, linked against libgo.so. I am using gccgo-11 on ubuntu 20.04, pulled from apt.
The resulting executable is small, as expected. About 50Kb for a basic hello world.
As soon as…
I have a program entirely written in C that uses multiple object (.o) files in it. These files are all packed inside an archive file (.a) which, in turn, is used at compile-time of the program's main (.c) file.
I want to write a new file for this…
I've been experimenting with gc and gccgo, and I've encountered some odd behaviour.
Using a program I once wrote to test some theorem, I got these results: (I removed unnecessary information for readablitity)
$ time go build -compiler gc -o…
I am able to perform integer division in go by this program :
package main
import "fmt"
func main() {
a := 10
b := 5
fmt.Println(a/b)
}
Then I made a program in go that has functions for +, -, * and /.
and I made a program in C that calls…
I decided to give Go a try, and thus wrote the following bit of code:
package main
import "fmt"
func main() {
fmt.Printf("Hello, World\n")
}
I saved that under main.go, and then tried to compile it using gccgo main.go -o main. This worked.…
I am trying to set up my Go compiler on Linux which could compile project for any other architecture or platform. I am using default packages from official Ubuntu 14.04 repositories and I am using 64 bit system. This configuration allows me to…