The MIPSpro compiler system consists of a set of components that enable you to create new 32-bit and 64-bit executable programs (as well as old 32-bit executables) using languages such as C, C++, and Fortran.
A new 32-bit mode, n32, was introduced with the IRIX 6.1 operating system. This new 32-bit mode has the following features:
Full access to all features of the hardware
MIPS III and MIPS IV instruction set architecture (ISA)
Improved calling convention
32 64-bit floating-point registers
32 64-bit general purpose registers
Dwarf debugging format
The new 32-bit mode (n32) provides better performance than the old 32-bit mode available in IRIX releases prior to 6.1. When you compile with the -n32 option, the chip executes in 64-bit mode and the software restricts addresses to 32 bits. For more information about n32, refer to the MIPSpro N32 ABI Handbook.
In addition, the MIPSpro compiler system:
Uses executable and linking format (ELF) for object files. ELF is the format specified by System V Release 4 Applications Binary Interface (SVR4 ABI). Refer to “Executable and Linking Format” in Chapter 2, for additional information.
Uses shared libraries, called dynamic shared objects (DSOs). DSOs are loaded at run time, instead of at link time, by the run-time linker, rld. The code for DSOs is not included in executable files; thus, executables built with DSOs are smaller than those built with non-shared libraries, and multiple programs can use the same DSO at the same time. For more information, see Chapter 3, “Using Dynamic Shared Objects”.
Table 1-1, summarizes the compiler system components and the task each performs.
Write and edit programs
vi, jot , emacs
Compile, link, and load programs
cc, CC , f77, f90, as
Object file analyzer
Analyze object files
dis, dwarfdump , elfdump, file, nm, size
Analyze program performance
cvperf, prof, sscompare, ssrun
Produce object-file libraries
Link object files
Link Dynamic Shared Objects at runtime
A single program called a compiler driver (such as cc, CC, f77, or f90) invokes the following major components of the compiler system (refer to Figure 1-1)
You can invoke a compiler driver with various options (described in the relevant man page, such as cc(1)) and with one or more source files as arguments. All specified source files are automatically sent to the macro preprocessor. To prevent running the preprocessor, use the -nocpp option on the driver command line.
Your program can take advantage of multiple CPUs (when present) to achieve higher computation rates. The optional parallel analyzers produce parallelized source code from standard source code. For more information about these packages and how to obtain them, contact your dealer or sales representative.
The compiler front end translates the source code into an intermediate tree representation. The compiler back end translates the intermediate code into object code. The language compilers share the same back end, which combines optimization and code generation in one phase. (For more information about optimization, see Chapter 4, “Optimizing Program Performance”).
When you compile or link programs, by default the compiler searches specific libraries depending on the compilation mode (shown in Table 1-2). Certain default libraries are automatically linked.
/usr/lib, /lib, and /usr/local/lib
/usr/lib32, /lib32, and /usr/local/lib
/usr/lib64, /lib64, and /usr/local/lib
Compiler drivers and their respective libraries are listed in Table 1-3.
libC.so, libc.so, libCsup.so
libftn.so, libftn90.so, libc.so, libm.so
Figure 1-1 shows compilation flow from source file to executable file (a.out).