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 '-fgo-relative-import-path=_/home/fuz/src/go/src/github.com/fuzxxl/ppm'
These are the tools on my machine:
$ go version
go version devel +dda87c8bcba1 Wed Apr 17 13:25:28 2013 -0700 linux/amd64
$ gccgo --version
gccgo (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Why do I get the error shown above? What can I do to fix this?
The -fgo-relative-import-path
option was committed on 2012-10-30, whereas GCC 4.7.2 (including gccgo) was already released on 2012-09-20. So gccgo 4.7.2 simply does not yet contain support for this option.
Upgrading gccgo to 4.7.3 (or 4.8.0) should fix this.
"Raring Ringtail" is the code name for Ubuntu 13.04, scheduled for release on 25 April 2013.
GNU Go compiler: Package (raring): gccgo-4.7 (4.7.3-1ubuntu1)
In the interim, I'm using the Ubuntu 13.04 (Raring Ringtail) Daily Build.
For example,
$ uname -a
Linux ubuntu 3.8.0-19-generic #29-Ubuntu SMP Wed Apr 17 18:16:28 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
$ gccgo --version
gccgo (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3
$ export GOPATH=/home/peter/gopath
$ export LANG=C
$ go get -d github.com/fuzxxl/ppm
$ cd $GOPATH/src/github.com/fuzxxl/ppm
$ go build -compiler gccgo
$ go install -compiler gccgo
$