2

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?

fuz
  • 88,405
  • 25
  • 200
  • 352

2 Answers2

2

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.

earl
  • 40,327
  • 6
  • 58
  • 59
  • Thank you for your help. Do you know if there is any PPA that contains the newest gccgo version for Ubuntu? – fuz Apr 20 '13 at 16:46
  • The (as of today) upcoming Ubuntu 13.04 release will contain gccgo 4.7.3. I don't know of any PPA containing newer pre-built packages for the (as of today) current Ubuntu 12.10. – earl Apr 20 '13 at 23:04
0

"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
$ 
peterSO
  • 158,998
  • 31
  • 281
  • 276