Chapter 6. Cross-Compiler and Run-Time Interfacing

Table of Contents
6.1. Cross-Compiler Issues
6.2. Compiler Phase and Pass Structure
6.3. Compiler Module Structure
6.4. Compiler Construction Tools
6.5. Installation
6.6. Run-Time System Issues
6.7. Exception Handling System
6.8. I/O Interfaces
6.9. Documentation

The internal structure of the ERC32 Ada cross-compiler and run-time system are described in this chapter.

6.1. Cross-Compiler Issues

The following sections describe the design of the native and cross compilers in general, and provide a more detailed description of the ERC32 Ada compiler.

6.1.1. Background

The ERC32 Ada compiler uses the front end of the GNAT compiler from New York University. This compiler was developed with funding from the United States Department of Defense to be the compiler promised in the Ada requirements document known as Steelman.

GNAT consists of an Ada 95 front end, a code generator, and a middle phase that translates the Ada program into the intermediate language used by the code generator. The code generator is taken from GCC—the GNU C Compiler, as are the other tools required to complete the compilation system.

The Free Software Foundation designed GCC to be the compiler of the GNU UNIX-like operating system, and was required to support the ANSI C programming language and work with other UNIX tools. It was also required to generate high-quality code for any computer that could be expected to run UNIX.

These requirements led to the implementation of a compiler that became an obvious base for other programming languages, and today GCC supports C++, Objective C, Pascal, Modula-3, FORTRAN, and Ada.

GCC has also been developed to meet the needs of embedded system programmers, and can be configured as a cross compiler using a minimal run-time system. The GNAT Ada front end is the most complete implementation of the Ada 95 language available. Most of the optional features are supported, including the distributed systems Annex and the safety-critical Annex.