Questions tagged [gccgo]

gccgo is a compiler for the Go language.

gccgo is a compiler for the Go language.

See http://golang.org/doc/install/gccgo

62 questions
113
votes
1 answer

What are the primary differences between 'gc' and 'gccgo'?

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…
Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
23
votes
4 answers

Go language on iPhone

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…
Max
  • 6,286
  • 5
  • 44
  • 86
20
votes
1 answer

how is it possible to get gccgo produce vectorized code?

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…
paolo_losi
  • 283
  • 1
  • 7
10
votes
2 answers

Using C(++) in a Go application for performance

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…
PentaKon
  • 4,139
  • 5
  • 43
  • 80
10
votes
2 answers

go 1.5 cross compile using cgo on OS X to linux and windows

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…
Calin
  • 2,110
  • 1
  • 21
  • 36
8
votes
3 answers

gccgo on Precise

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,…
Matt Joiner
  • 112,946
  • 110
  • 377
  • 526
7
votes
1 answer

Using Go 1.5 buildmode=c-archive with net/http.Server linked from C

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…
shazow
  • 17,147
  • 1
  • 34
  • 35
7
votes
3 answers

How to build full go program binary with gccgo?

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…
user1529891
6
votes
0 answers

How to import value in GCCGO to perform something like go linker ldflags -X does in GC compiler

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…
Anjie
  • 61
  • 2
5
votes
0 answers

gccgo dynamic linking and modules

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…
Daniel
  • 428
  • 3
  • 8
5
votes
2 answers

Using Go on existing C project

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…
Lopson
  • 1,202
  • 1
  • 8
  • 20
5
votes
2 answers

Why are binaries built with gccgo smaller (among other differences?)

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…
Evert Heylen
  • 960
  • 9
  • 28
4
votes
2 answers

integer division in Go called from C

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…
Ridhima
  • 308
  • 1
  • 3
  • 14
4
votes
1 answer

"no debug info in ELF executable errno" when running a binary built with gccgo

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.…
Koz Ross
  • 3,040
  • 2
  • 24
  • 44
4
votes
1 answer

How to compile cross-platform Go language project on Linux?

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…
user1621987
1
2 3 4 5