GNU Compiler Collection (GCC) Internals
5.3.9 Anatomy of a Target Back End
A back end for a target architecture in GCC has the following parts:
-
A directory `machine' under `gcc/config', containing a
machine description `machine.md' file (see section Machine Descriptions), header files `machine.h' and
`machine-protos.h' and a source file `machine.c'
(see section Target Description Macros and Functions),
possibly a target Makefile fragment `t-machine'
(see section The Target Makefile Fragment), and maybe
some other files. The names of these files may be changed from the
defaults given by explicit specifications in `config.gcc'.
-
Entries in `config.gcc' (see section The `config.gcc' File) for the systems with this target
architecture.
-
Documentation in `gcc/doc/invoke.texi' for any command-line
options supported by this target (see section Run-time Target Specification). This means both entries in the summary table
of options and details of the individual options.
-
Documentation in `gcc/doc/extend.texi' for any target-specific
attributes supported (see section Defining target-specific uses of
__attribute__), including where the
same attribute is already supported on some targets, which are
enumerated in the manual.
-
Documentation in `gcc/doc/extend.texi' for any target-specific
pragmas supported.
-
Documentation in `gcc/doc/extend.texi' of any target-specific
built-in functions supported.
-
Documentation in `gcc/doc/md.texi' of any target-specific
constraint letters (see section Constraints for Particular Machines).
-
A note in `gcc/doc/contrib.texi' under the person or people who
contributed the target support.
-
Entries in `gcc/doc/install.texi' for all target triplets
supported with this target architecture, giving details of any special
notes about installation for this target, or saying that there are no
special notes if there are none.
-
Possibly other support outside the `gcc' directory for runtime
libraries. FIXME: reference docs for this. The libstdc++ porting
manual needs to be installed as info for this to work, or to be a
chapter of this manual.
If the back end is added to the official GCC CVS repository, the
following are also necessary:
-
An entry for the target architecture in `readings.html' on the
GCC web site, with any relevant links.
-
A news item about the contribution of support for that target
architecture, in `index.html' on the GCC web site.
-
Normally, one or more maintainers of that target listed in
`MAINTAINERS'. Some existing architectures may be unmaintained,
but it would be unusual to add support for a target that does not have
a maintainer when support is added.