Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
253c1392
Commit
253c1392
authored
Feb 18, 2012
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
doc: update gccgo_contribute.html
R=golang-dev, r CC=golang-dev
https://golang.org/cl/5673080
parent
a5f21c95
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
55 deletions
+60
-55
doc/gccgo_contribute.html
doc/gccgo_contribute.html
+60
-55
No files found.
doc/gccgo_contribute.html
View file @
253c1392
...
@@ -5,90 +5,95 @@
...
@@ -5,90 +5,95 @@
<h2>
Introduction
</h2>
<h2>
Introduction
</h2>
<p>
<p>
These are some notes on contributing to the
<code>
gccgo
</code>
These are some notes on contributing to the gccgo frontend for GCC.
frontend for GCC. For information on contributing to parts of Go other
For information on contributing to parts of Go other than gccgo,
than
<code>
gccgo
</code>
, see
<a
href=
"contribute.html"
>
Contributing to
see
<a
href=
"contribute.html"
>
Contributing to the Go project
</a>
. For
the Go project
</a>
. For information on building
<code>
gccgo
</code>
information on building gccgo for yourself,
for yourself, see
<a
href=
"gccgo_install.html"
>
Setting up and using
see
<a
href=
"gccgo_install.html"
>
Setting up and using gccgo
</a>
.
gccgo
</a>
.
</p>
</p>
<h2>
Legal Prerequisites
</h2>
<h2>
Legal Prerequisites
</h2>
<p>
<p>
You must follow the
<a
href=
"contribute.html#copyright"
>
Go copyright
You must follow the
<a
href=
"contribute.html#copyright"
>
Go copyright
rules.
</a>
rules
</a>
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
<a
href=
"http://gcc.gnu.org/contribute.html"
>
GCC
contribution rules
</a>
.
</p>
</p>
<h2>
Code
</h2>
<h2>
Code
</h2>
<p>
<p>
The
source code for the
<code>
gccgo
</code>
frontend may be found at
The
master sources for the gccgo
frontend may be found at
<a
href=
"http://code.google.com/p/gofrontend"
>
http://code.google.com/p/gofrontend
</a>
.
<a
href=
"http://code.google.com/p/gofrontend"
>
http://code.google.com/p/gofrontend
</a>
.
Changes made to that project are routinely merged into the source code
The master sources are not buildable by themselves, but only in
hosted at
<code>
gcc.gnu.org
</code>
. The
<code>
gofrontend
</code>
conjunction with GCC (in the future, other compilers may be
project includes only the Go frontend proper. These are the files
supported). Changes made to the gccgo frontend are also applied to
which in the
<code>
gcc
</code>
sources may be found in the
the GCC source code repository hosted at
<code>
gcc.gnu.org
</code>
. In
directories
<code>
gcc/go
</code>
and
<code>
libgo
</code>
.
the
<code>
gofrontend
</code>
repository, the
<code>
go
</code>
directory
The
<code>
gcc
</code>
sources also include a copy of
is mirrored to the
<code>
gcc/go/gofrontend
</code>
directory in the GCC
the
<code>
test
</code>
directory
repository, and the
<code>
gofrontend
</code>
<code>
libgo
</code>
from
<a
href=
"http://code.google.com/p/go"
>
the main Go repository
</a>
.
directory is mirrored to the GCC
<code>
libgo
</code>
directory. In
addition, the
<code>
test
</code>
directory
from
<a
href=
"http://code.google.com/p/go"
>
the main Go repository
</a>
is mirrored to the
<code>
gcc/testsuite/go.test/test
</code>
directory
in the GCC repository.
</p>
<p>
<p>
The frontend is written in C++ and as such the GNU coding standards do
Changes to these directories always flow from the master sources to
not entirely apply; in writing code for the frontend, follow the
the GCC repository. The files should never be changed in the GCC
formatting of the surrounding code. Although the frontend is
repository except by changing them in the master sources and mirroring
currently closely tied to the rest of the
<code>
gcc
</code>
codebase,
them.
we plan to make it more independent. Any new code that uses other
parts of
<code>
gcc
</code>
should be placed in an appropriate file,
such as
<code>
gogo-tree.cc
</code>
. Eventually
all
<code>
gcc
</code>
-specific code should migrate to
a
<code>
gcc-interface
</code>
subdirectory.
</p>
</p>
<p>
<p>
The run-time library for
<code>
gccgo
</code>
is mostly the same as the
The gccgo frontend is written in C++. It follows the GNU coding
library in
<a
href=
"http://code.google.com/p/go"
>
the main Go
standards to the extent that they apply to C++. In writing code for
repository
</a>
. The library code in the Go repository is periodically
the frontend, follow the formatting of the surrounding code. Although
copied into the
<code>
gofrontend
</code>
and the
<code>
gcc
</code>
the frontend is currently tied to the rest of the GCC codebase, we
repositories. Accordingly, most library changes should be made in the
plan to make it more independent. Eventually all GCC-specific code
main Go repository. Changes to the few
<code>
gccgo
</code>
-specific
will migrate out of the frontend proper and into GCC proper. In the
parts of the library should follow the process described here.
GCC sources this will generally mean moving code
The
<code>
gccgo
</code>
-specific parts of the library are everything in
from
<code>
gcc/go/gofrontend
</code>
to
<code>
gcc/go
</code>
.
the
<code>
libgo
</code>
directory except for the
<code>
libgo/go
</code>
subdirectory.
</p>
</p>
<h2>
Testing
</h2>
<p>
<p>
All patches must be tested. There are two test suites. A patch that
The run-time library for gccgo is mostly the same as the library
introduces new failures is not acceptable.
in
<a
href=
"http://code.google.com/p/go"
>
the main Go repository
</a>
.
The library code in the Go repository is periodically merged into
the
<code>
libgo/go
</code>
directory of the
<code>
gofrontend
</code>
and
then the GCC repositories, using the shell
script
<code>
libgo/merge.sh
</code>
. Accordingly, most library changes
should be made in the main Go repository. The files outside
of
<code>
libgo/go
</code>
are gccgo-specific; that said, some of the
files in
<code>
libgo/runtime
</code>
are based on files
in
<code>
src/pkg/runtime
</code>
in the main Go repository.
</p>
</p>
<h2>
Testing
</h2>
<p>
<p>
To run the compiler test suite, run
<code>
make check-go
</code>
in the
All patches must be tested. A patch that introduces new failures is
<code>
gcc
</code>
subdirectory of your build directory. This will run
not acceptable.
various tests underneath
<code>
gcc/testsuite/go.*
</code>
. This
includes a copy of the tests in the main Go repository, which are run
using the DejaGNU script found in
in
<code>
gcc/testsuite/go.test/go-test.exp
</code>
. Many of the
compiler tests may be run without the Go library, but some do require
the library to built first.
</p>
</p>
<p>
<p>
To run the library test suite, run
<code>
make
To run the gccgo test suite, run
<code>
make check-go
</code>
in your
check-target-libgo
</code>
in the top level of your build directory.
build directory. This will run various tests
under
<code>
gcc/testsuite/go.*
</code>
and will also run
the
<code>
libgo
</code>
testsuite. This copy of the tests from the
main Go repository is run using the DejaGNU script found in
in
<code>
gcc/testsuite/go.test/go-test.exp
</code>
.
</p>
</p>
<p>
<p>
Most new tests should be submitted to the main Go repository for
Most new tests should be submitted to the main Go repository for
later
copying into the
<code>
gccgo
</code>
repository. If there is a need
mirroring into the GCC repository. If there is a need for specific
for specific tests for
<code>
gccgo
</code>
, they should go in
tests for gccgo
, they should go in
the
<code>
gcc/testsuite/go.go-torture
</code>
the
<code>
gcc/testsuite/go.go-torture
</code>
or
<code>
gcc/testsuite/go.dg
</code>
directories in
or
<code>
gcc/testsuite/go.dg
</code>
directories in the GCC repository.
the
<code>
gcc.gnu.org
</code>
repository.
</p>
</p>
<h2>
Submitting Changes
</h2>
<h2>
Submitting Changes
</h2>
...
@@ -97,5 +102,5 @@ the <code>gcc.gnu.org</code> repository.
...
@@ -97,5 +102,5 @@ the <code>gcc.gnu.org</code> repository.
Changes to the Go frontend should follow the same process as for the
Changes to the Go frontend should follow the same process as for the
main Go repository, only for the
<code>
gofrontend
</code>
project
main Go repository, only for the
<code>
gofrontend
</code>
project
rather than the
<code>
go
</code>
project. Those changes will then be
rather than the
<code>
go
</code>
project. Those changes will then be
merged into the
<code>
gcc
</code>
sources.
merged into the
GCC
sources.
</p>
</p>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment