Menu
  • HOME
  • TAGS

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

linux,go,webkit,cross-platform,gccgo

With Go 1.2, the cgo feature is disabled when cross compiling code. This means that any source file containing import "C" will not be compiled, which leaves many packages unusable. So while your simple "hello world" program compiles, an equivalent one using cgo will fail: package main /* #include <stdlib.h>...

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

linux,go,gccgo

So thanks to a clue by Dean, I've worked out the issue and solved it. The issue was caused by me installing Go via apt-get, then removing it (via apt-get), then installing Go from the golang website. There were still files left over from the first install, which were probably...

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

go,gccgo

There are a bunch of differences--bradfitz talked about some of them in a May 2014 talk: gccgo can produce a binary that dynamically links in libgo, which makes the output smaller but means the relevant library to be installed on the target machine. Go binaries without cgo don't have that...

Using Go on existing C project

c,go,gccgo

This may not be what you want, but in Go 1.5, that's coming this August, you'll be able to build C-compatible libraries with the go tool. So with this in your _main.c #include <stdio.h> int main() { char *string_to_pass = NULL; if (asprintf(&string_to_pass, "This is a test.") < 0) {...