This section discusses the common features of the MicroBlaze™ and Cortex® A9, A53, and R5 processor compilers. The following figure displays the GNU tool flow.
The GNU compiler is named
mb-gcc for MicroBlaze,
Cortex A9 cores,
aarch64-none-elf-gcc for Cortex-A53,
armr5-none-eabi-gcc for Cortex-R5F.
The GNU compiler is a wrapper that calls the following executables:
- Pre-processor (
- This is the first pass invoked by the compiler. The pre-processor replaces all macros with definitions as defined in the source and header files.
- Machine and language specific compiler
- This compiler works on the pre-processed code, which is the output of the first
stage. The language-specific compiler is one of the following:
- C Compiler (
- The compiler responsible for most of the optimizations done on the input C code and for generating assembly code.
- C++ Compiler (
- The compiler responsible for most of the optimizations done on the input C++ code and for generating assembly code.
- C Compiler (
- The assembly code has mnemonics in assembly language. The assembler converts
these to machine language. The assembler also resolves some of the labels
generated by the compiler. It creates an object file which is passed on to the
linker .The assembler executables are
arm-none-eabi-asfor Cortex A9 cores,
aarch64-none-elf-asfor Cortex-A53, and
- Links all the object files generated by the assembler. If libraries are provided
on the command line, the linker resolves some of the undefined references in the
code by linking in some of the functions from the assembler. The linker
arm-none-eabi-ldfor Cortex A9 cores,
aarch64-none-elf-ldfor Cortex-A53, and
Executable options are described in the following sections:
- Commonly Used Compiler Options: Quick Reference
- Linker Options
- MicroBlaze Compiler Usage and Options
- MicroBlaze Linker Options
- Arm Cortex-A9 Compiler Usage and Options
mb-gcc, and references to G++ refer to the MicroBlaze C++ compiler,