Only the most useful options are listed here; see below for the
The gccgo command is a frontend to gcc and
supports many of the same options. This manual
only documents the options specific to gccgo.
The gccgo command may be used to compile Go source code into
an object file, link a collection of object files together, or do both
Go source code is compiled as packages. A package consists of one or
more Go source files. All the files in a single package must be
compiled together, by passing all the files as arguments to
gccgo. A single invocation of gccgo may only
compile a single package.
One Go package may "import" a different Go package. The imported
package must have already been compiled; gccgo will read
the import data directly from the compiled package. When this package
is later linked, the compiled form of the package must be included in
the link command.
Specify a directory to use when searching for an import package at
When linking, specify a library search directory, as with
Go permits a single program to include more than one package with the
same name. This option is required to make this work with
gccgo. The argument to this option may be any string. Each
package with the same name must use a distinct -fgo-prefix
option. The argument is typically the full path under which the
package will be installed, as that must obviously be unique.
By default gccgo will warn about functions which have one or
more return parameters but lack an explicit "return" statement.
This warning may be disabled using
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, the Front-Cover Texts being (a) (see below), and
with the Back-Cover Texts being (b) (see below).
A copy of the license is included in the
man page gfdl(7).
(a) The FSF's Front-Cover Text is:
A GNU Manual
(b) The FSF's Back-Cover Text is:
You have freedom to copy and modify this GNU Manual, like GNU
software. Copies published by the Free Software Foundation raise
funds for GNU development.