These are some notes on contributing to the gccgo frontend for GCC. For information on contributing to parts of Go other than gccgo, see Contributing to the Go project. For information on building gccgo for yourself, see Setting up and using gccgo.
You must follow the Go copyright rules for all changes to the gccgo frontend and the associated libgo library. Code that is part of GCC rather than gccgo must follow the general GCC contribution rules.
The master sources for the gccgo frontend may be found at
The master sources are not buildable by themselves, but only in
conjunction with GCC (in the future, other compilers may be
supported). Changes made to the gccgo frontend are also applied to
the GCC source code repository hosted at
gofrontend repository, the
is mirrored to the
gcc/go/gofrontend directory in the GCC
repository, and the
directory is mirrored to the GCC
libgo directory. In
from the main Go repository
is mirrored to the
in the GCC repository.
Changes to these directories always flow from the master sources to the GCC repository. The files should never be changed in the GCC repository except by changing them in the master sources and mirroring them.
The gccgo frontend is written in C++. It follows the GNU coding
standards to the extent that they apply to C++. In writing code for
the frontend, follow the formatting of the surrounding code. Although
the frontend is currently tied to the rest of the GCC codebase, we
plan to make it more independent. Eventually all GCC-specific code
will migrate out of the frontend proper and into GCC proper. In the
GCC sources this will generally mean moving code
The run-time library for gccgo is mostly the same as the library
in the main Go repository.
The library code in the Go repository is periodically merged into
libgo/go directory of the
then the GCC repositories, using the shell
libgo/merge.sh. Accordingly, most library changes
should be made in the main Go repository. The files outside
libgo/go are gccgo-specific; that said, some of the
libgo/runtime are based on files
src/pkg/runtime in the main Go repository.
All patches must be tested. A patch that introduces new failures is not acceptable.
To run the gccgo test suite, run
make check-go in your
build directory. This will run various tests
gcc/testsuite/go.* and will also run
libgo testsuite. This copy of the tests from the
main Go repository is run using the DejaGNU script found
Most new tests should be submitted to the main Go repository for later
mirroring into the GCC repository. If there is a need for specific
tests for gccgo, they should go in
gcc/testsuite/go.dg directories in the GCC repository.
Changes to the Go frontend should follow the same process as for the
main Go repository, only for the
gofrontend project and
firstname.lastname@example.org mailing list
rather than the
go project and the
email@example.com mailing list. Those changes
will then be merged into the GCC sources.