Specifications
Embedded System Tools Guide (EDK 6.2i) www.xilinx.com 167
UG111 (v1.4) January 30, 2004 1-800-255-7778
Compiler Usage and Options
R
-On
The GNU compiler provides optimizations at different levels. These optimization levels 
are applied only to the C and C++ source files.
Note: Optimization levels 1 and above will cause code re-arrangement. While debugging your 
code, use of no optimization level is advocated. When an optimized program is debugged through 
gdb, the displayed results might seem inconsistent.
-v 
This option executes the compiler and all the tools underneath the compiler in verbose 
mode. This option gives complete description of the options passed to all the tools. This 
description is helpful in finding out the default options for each tool.
-save-temps
The GNU compiler provides a mechanism to save all the intermediate files generated 
during the compilation process. The compiler stores the following files
i Preprocessor output (input_file_name.i for C code and input_file_name.ii for C++ 
code) 
i Compiler (cc1) output in assembly format (input_file_name.s)
i Assembler output in elf format (input_file_name.s)
The default output of the entire compilation is stored as a.out.
-o Filename
The default output of the compilation process is stored in an elf file name a.out. The default 
name can be changed using the -o output_file_name. The output file is created in elf format.
-Wp,option
-Wa,option
-Wl,option
As described earlier in this chapter, the compiler (mb-gcc or powerpc-eabi-gcc) is a 
wrapper around other executables such as the preprocessor, compiler (cc1), assembler and 
the linker. These components of the compiler can be executed through the top level 
compiler or individually. 
Table 11-2: Optimizations for different values of n
n Optimization
0 No Optimization
1 Medium Optimization
2 Full optimization
3 full optimization, and also attempt automatic inlining of small 
subprograms.
S Optimize for speed










