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
4
votes
1 answer

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 the compiled packages. Use the -static option to do…
user1529891
4
votes
1 answer

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 ( "fmt" "github.com/usr/pkg" ) func init()…
Tianran Shen
  • 921
  • 2
  • 9
  • 11
3
votes
1 answer

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 important to note that the tests are successful when…
aedcv
  • 151
  • 1
  • 8
3
votes
1 answer

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 import "C" import "fmt" func main(){ fmt.Println(C.CMD_SET_ROUTE) } Here is the content of the file proxy.h: #ifndef…
Pensu
  • 3,263
  • 10
  • 46
  • 71
3
votes
2 answers

How to import and use .so file

Please give me example (code) how to import into main.go a .so file made gccgo?
user2614682
  • 193
  • 2
  • 14
3
votes
2 answers

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:*rgo/src/tictoc-demo$ gccgo -v Using built-in…
mnagel
  • 6,729
  • 4
  • 31
  • 66
2
votes
0 answers

Getting a Go executable(hugo) to run Intel Galileo/Quark

I'm trying to get hugo to work on my Alpine distro that's running on my Intel gallileo(Quark CPU). I've overcome a few hurdles already. This CPU Doesn't have MMX so gcc-go was needed to compile hugo into a binary (in a virtual machine) But after…
dmarkey
  • 193
  • 2
  • 8
2
votes
1 answer

GCC-Go - Optimize builds for specific architecture

How does one uses environment variables to optimize a go binary? For instance, with C and GCC, you would set CFLAGS="-O2 -march=znver1 to build with tier 2 optimizations, with specific optimizations for the Zen microarchitecture. I couldn't find an…
2
votes
1 answer

Cannot install gccgo on windows 10

I want to install gccgo, but I am on windows. I read the Setting up and using gccgo page on the golang page. The page said The simplest way to install gccgo is to install a GCC binary release built to include Go support. GCC binary releases are…
Ank i zle
  • 2,089
  • 3
  • 14
  • 36
2
votes
1 answer

string to char (*array)[]

//file.go func main() { message := "My Message :)" // I've tried this slice before. // tmpslice := (*[1 << 30]*C.char)(unsafe.Pointer(argv))[:length:length] argv := make([]*C.char, len(message)) for i, s := range str { cs :=…
0xdeadfeed
  • 23
  • 4
2
votes
1 answer

How to build SO library for ARM architecture

I need to build a shared library in Go. For this purpose, I used CGO and then built SO lib with options go build -o libUtil.so -buildmode=c-shared main.go Now, I need to do the same, but for ARM architecture. When I do not use CGO, I only do…
2
votes
3 answers

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 me on this? Go Version: go1.10.3…
adiN
  • 21
  • 1
  • 2
2
votes
1 answer

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 gccgo helloworld.go go build…
chingy
  • 31
  • 1
  • 3
2
votes
1 answer

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/golang/go/wiki/SliceTricks). The following code…
George
  • 131
  • 2
  • 8
2
votes
2 answers

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 command line option…
fuz
  • 88,405
  • 25
  • 200
  • 352