### What version of Go are you using (`go version`)? go version go1.6.1 gccgo (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1) linux/amd64 ### What operating system and processor architecture are you using (`go env`)? GOARCH="amd64" GOBIN="" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/home/aconway/go:/home/aconway/proton/proton-c/bindings/go" GORACE="" GOROOT="/usr/lib/golang" GOTOOLDIR="/usr/libexec/gcc/x86_64-redhat-linux/6.3.1" GO15VENDOREXPERIMENT="1" CC="/usr/bin/gcc" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0" CXX="/usr/bin/g++" CGO_ENABLED="1" ### What did you do? Create a package "tmp" containing a single "tmp.go" source file with one line: `package tmp` go test -race tmp ### What did you expect to see? go test -race tmp ? tmp [no test files] ### What did you see instead? go test -race tmp import cycle not allowed package tmp imports runtime imports runtime/internal/atomic imports runtime/race imports syscall imports internal/race imports runtime/race I do not have this problem if I use golang's go compiler, only with gccgo. I can see the problem on a real codebase, but the above reproducer shows it doesn't require any actual code to exhibit the problem, in particular you don't need `import "runtime"`. I have been seeing this problem since Go 1.4. I'm not sure whether it is a gcc problem or a go tools problem, I am reporting on both sites.
Reported as: https://github.com/golang/go/issues/18696 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79122
Note that the race detector doesn't work at all with gccgo. So while this is a pretty bad error message, the only fix for this bug is going to be to produce a better error message.
I thought that might be the case but couldn't find a clear statement after a fair bit of googling. Is there a 'limitations of gccgo' doc somewhere that lists the unsupported features? You can close this from my perspective, unless you want to keep it to track the error message/documentation issues.