There is a file pig.go on the golang.org website:
http://golang.org/doc/codewalk/functions/
in a box labeled doc/codewalk/pig.go
Compiling it with gccgo version (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1
gccgo pig.go
gives an error message about not finding math/rand
pig.go:9:11: error: import file ‘math/rand’ not found
Your version of gccgo implements an old version of the language. To compile Go 1 code, you need gccgo 4.7.1 or later.
If you can't or don't want to upgrade, you could probably just change the import from math/rand
to rand
and it will compile with gccgo 4.6.1. Not all programs will be so easy to backport, but this one happens to be.