Issues Building with gccgo

Hi all, I’m currently working on building the latest Couchbase master branch, but I seem to be having some issues with the Go dependency. I am on a system for which only gccgo (built from latest source) is available, not golang. According to the header in tlm/cmake/Modules/FindCouchbaseGo.cmake, building with gccgo should be possible, and the initial dependency check accepts it to fulfill the Go requirement. However, late in the compilation, I receive the following error:

Scanning dependencies of target n1ql-yacc
[100%] Executing: /opt/gccgo/bin/go tool yacc n1ql.y
go tool: no such tool "yacc"
make[4]: *** [../goproj/src/] Error 3
make[3]: *** [goproj/src/] Error 2
make[2]: *** [all] Error 2
make[1]: *** [compile] Error 2
make: *** [all] Error 2

This appears to occur during invocation of a macro in FindCouchbaseGo.cmake called GoYacc, which according to its comments cannot be run with gccgo, only golang. Assuming that the file’s main header is correct, and that compilation with gccgo is still possible, is there some flag that needs to be added in order to avoid the golang-only components?

Hi, which platform is this so I can try to add it to my personal CI server and reproduce the problem?

Thanks for the response! I’ve been working on building for RHEL 7.

Ok, that I won’t set up @ home given that it requires a license… Btw. you should be able to build go by:

cd /usr/local
git clone
cd go
git checkout -b go1.4.2 go1.4.2
cd src
cd ../../bin
ln -s ../go/bin/go

And then build the stuff (at least that’s what I’ve done on my CentOS builder). I’ll see if I can find another system and set it up with gccgo.


Thanks for the suggestion. Unfortunately, as I mentioned, golang isn’t an option on the target system; it doesn’t currently support the appropriate instruction set, whereas gcc does. As a note to follow on that, I have confirmed that the issue in question also crops up on a comparable x86-64 system, so it doesn’t appear to be related to the architecture.

Just a note that I was able to solve the issue by separately downloading and installing yacc from, then adding the result to the appropriate spot in the gccgo directory. Might also be worth noting that, as per this discussion here:!topic/golang-dev/990HVo40138, the Go community don’t seem to have much interest in adding yacc to gccgo by default, and in fact are proposing to move it out of the main golang repo as well.

1 Like