Questions tagged [gccgo]

gccgo is a compiler for the Go language.

0
votes
1answer
31 views

Error accessing aerospike C client through Cgo

I am trying to learn Cgo, so i tried accessing aerospike client from Cgo package main // #cgo CFLAGS: -g -Wall // #include <stdlib.h> // #include <string.h> // #include "aerospike-...
-2
votes
1answer
22 views

how to build hyperledger fabric with gccgo

Is there a way to build hyperledger fabric using gccgo? I want to do this in order to use -finstrument-functions option of gcc to trace function calls. But I encountered two problems. My steps are as ...
0
votes
0answers
62 views

cgo cross compiling from amd64(linux) to arm64(linux)

I am trying to build a go code for "arm64" architecture from "amd64" using a arm64 based so. I get the below mentioned error when I build the go code with the shared library. Can someone please assist ...
1
vote
0answers
66 views

filebeat/libbeat compiler on gccgo for solaris/sparc

I am driving to compile the project filebeat going for solar / SPARC environments. Officially, Elastic tools are not supported by Solaris. Neamoins, there is circumventenement to this problem / ...
0
votes
0answers
18 views

how to dump gimple tree of a Go application compiled by gccgo

Just for simplicity, I would refer gcc as the whole compiler suite and gccgo as the whole go compiler suite that includes gcc backend. When I would need to refer particularly the front-end, I would ...
1
vote
1answer
63 views

cgo on windows : naming of loaded dll

I am trying to use gorocksdb which is a cgo package wapping the rocksdb library on windows. I built the rocksdb library with vcpkg which gave me as output rocksdb-shared.dll. I set the build path to ...
0
votes
1answer
113 views

How do I get cgo to build object files without main() being defined?

I have a project written entirely in C. I just need to call one function which will have to be coded in GO. Therefore I am using cgo to build C files and then I would like to use the resulting ...
0
votes
0answers
87 views

Copy contents of GOLang Structure to C structure [duplicate]

I want to copy contents of GOLang structure to C Structure. Here i want the populated GO Struct (type test struct) to be copied to C structure test_c. Have put the following logic. I have accessed C ...
0
votes
0answers
83 views

Concurrency problems with gccgo

I've just landed in the the GO-sphere, so, as usually, I'm trying to implement some of the classics in the new language to make some comparison. I'm experiencing a strange situation with the ...
0
votes
1answer
211 views

How to return C pointer from Go functions?

I have question is it possible to return from Go function pointer on C? For example main.c can be: struct open_db_return db_ptr = open_db(db_path); GoSlice backet = {"DB", 2, 2}; GoSlice key = {"...
0
votes
1answer
139 views

build gccgo got linker error

I am building gccgo given the instruction here. However, I got error message after I did: ../gccgo/configure --prefix=/opt/gccgo --enable-languages=c,c++,go --with-ld=/opt/gold/bin/ld make Error: ...
2
votes
1answer
510 views

How can I debug C code called with cgo?

Background I'm currently in the process of writing a Go interface for this library. As a first step, I'm trying to run the tests in /test/test_pc.c by calling them through Go wrappers. It is ...
0
votes
0answers
77 views

go install fail to generate binary

There are two folds to this problem: 1) Go install not able to generate binary go version go1.7.3 linux/amd64 go env: GOARCH="amd64" GOBIN="" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="...
0
votes
0answers
323 views

Go import package: pkg found with go (-compiler gccgo), not found with gccgo

Go/gccgo version: 6.3.0 I am building a program with go build -compiler gccgo -x <args> <args> program.go. Build process fails with % /usr/bin/gccgo -c -g -fgo-pkgpath=<file_path>/...
1
vote
1answer
624 views

build Go with gccgo - fork/exec no such file or directory

I am trying to run a simple helloworld.go on RHEL 6.8. % cat helloworld.go package main import "fmt" func main() { fmt.Println("hello world") } The GC compiler works ok % go build -compiler ...
1
vote
0answers
90 views

gccgo and LD_PRELOAD

package hello import "fmt" func Hello() { fmt.Println("hello, world!") } gccgo -c hello.go -o libhello.so -shared nm libhello.so ... 0000000000000000 T go.hello.Hello 0000000000000000 R go.hello....
1
vote
0answers
671 views

OSX Golang static compile, and installing gccgo

To outline my end goal. I want to compile a go application, statically linking to QT5. I have statically compiled QT5. Now I need to compile my Go program. As I understand it to do this, I have to ...
0
votes
1answer
457 views

How to return array of C struct from C function to go?

I have a C function which will return an array of structure to go function. How can I receive the array of structure and interpret or cast to go structure? Here is the code snippet typedef struct ...
7
votes
2answers
2k views

Using C(++) in a GoLang 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 ...
2
votes
1answer
89 views

delete element from slice difference gccgo vs gc

I found a really strange issue with GCCGO and I was wondering if someone could explain it. I'm trying to delete an element from a slice by index using the suggested slice tricks (https://github.com/...
1
vote
2answers
288 views

Unable to get the stack trace with a corefile from a cgo routine when using golang

I am using Golang and cgo. When my C code raises an assert(), I am unable to see the stack trace of the C code when using cgo. Instead, I see the stack trace of the golang runtime that caught the ...
0
votes
0answers
191 views

Setting up the workspace in GOLang?

I can not in any way to customize the workspace in ArchLinux. form.go:6:24: ошибка: import file «github.com/google/gxui» not found "github.com/google/gxui" ^ ...
0
votes
1answer
798 views

how to build static program with gccgo

I has a prblem when I use gccgo to build static programe version 1> use go build go build -compiler gccgo -gccgoflags '-static -L/lib64' test.go result: /usr/bin/ld: cannot find -lgo /usr/bin/ld: ...
0
votes
0answers
52 views

error: unknown field ‘Hash’ in ‘rsa.PSSOptions’

So, I am building docker that uses rsa module of golang. I am using golang by building gcc, which has gccgo. linux-l853:~/docker # go version go version gccgo (GCC) 5.0.0 20141113 (experimental) ...
6
votes
2answers
3k views

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 ...
1
vote
0answers
119 views

Gccgo error passing and modifying C struct in go

I'm attempting to convert a go library to be called by C and I'm starting with a simple test (based on an example answering another question I found that worked) file but I'm getting errors when I try ...
3
votes
1answer
219 views

Not able to run C call from go

I am trying to run a C call from go language code. Here is the program I am running: package main // #include<proxy.h> import "C" import "fmt" func main(){ fmt.Println(C.CMD_SET_ROUTE) } ...
7
votes
1answer
932 views

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 ...
5
votes
2answers
434 views

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 (...
4
votes
2answers
241 views

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 +, -...
1
vote
1answer
604 views

gccgo 4.9.2 dynamic linker error: undefined reference to `sync..import'

The source code is package main import "fmt" func main() { fmt.Println("hello world") } The Object file is built without error root@OpenWrt:/mnt/sda3# gccgo -v -c hello.go Using built-in specs. ...
0
votes
1answer
1k views

Golang cross-compilation: gccgo - unrecognized command line option `-marm`

I'm trying to compile a Go app for linux/arm and keep running into problems on my Ubuntu machine. When I run GOOS=linux GOARCH=arm go build in my source directory, I get tons of erorrs that are ...
5
votes
2answers
711 views

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 ...
1
vote
2answers
1k views

How to import and use .so file in golang program

Please give me example (code) how to import into main.go a .so file made gccgo?
60
votes
1answer
21k views

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 ...
3
votes
1answer
630 views

“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 ...
4
votes
1answer
2k views

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 ...
20
votes
1answer
401 views

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 } ...
4
votes
1answer
2k views

gccgo -static vs -static-libgo

What is the difference between -static and -static-libgo for gccgo? The documentation doesn't seem to really shed light on what is going on: Use the -static-libgo option to link statically against ...
3
votes
2answers
2k views

invalid memory address or nil pointer dereference

I am new to gccgo and I need help with compiling/running the below code (that works all right with the "standard" go compiler (sorry, I do not know the proper nomenclature)): my gcc: nailor@macbuntu:...
2
votes
2answers
472 views

gccgo does not know -fgo-relative-import-path

I tried to compile some code with gccgo on my machine: $ export LANG=C $ go get -d github.com/fuzxxl/ppm $ cd $GOPATH/src /github.com/fuzxxl/ppm $ go build -compiler gcc gccgo: error: unrecognized ...
6
votes
3answers
5k views

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 ...
3
votes
1answer
3k views

How to import non-standard-library packages use gccgo

First of all, all these code can be built successfully using go tool(e.g. go build, go install) For say I got an a.go which tries to import a non-standard-library pkg from github: package a import (...
22
votes
3answers
16k views

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 ...
8
votes
3answers
1k views

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 ...