This section discusses the common features of the MicroBlaze™ and MicroBlaze™ -V, and Cortex® A9, A53, A72, and R5 processor compilers. The following figure displays the GNU tool flow.
Figure 1. GNU Tool Flow
The GNU compilers have the following names:
- MicroBlaze and MicroBlaze™ -V
-
mb-gcc - Cortex A9 cores
-
arm-none-eabi-gcc - Cortex-A53 and Cortex-A72
-
aarch64-none-elf-gcc - Cortex-R5F
-
armr5-none-eabi-gcc
The GNU compiler is a wrapper that calls the following executables:
- Pre-processor (
cpp0) - 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 (
cc1) - The compiler responsible for most of the optimizations done on the input C code and for generating assembly code.
- C++ Compiler (
cc1plus) - The compiler responsible for most of the optimizations done on the input C++ code and for generating assembly code.
- C Compiler (
- Assembler
- The assembly code has mnemonics in assembly language. The assembler does the
following:
- Converts mnemonics to machine language
- Resolves some of the labels generated by the compiler
- Creates an object file that passes on to the linker.
- MicroBlaze and MicroBlaze™ -V
-
mb-as - Cortex A9 cores
-
arm-none-eabi-as - Cortex-A53 and Cortex-A72
-
aarch64-none-elf-as - Cortex-R5F
-
armr5-none-eabi-as
- Linker
- Links all object files generated by the assembler. If you provide libraries
on the command line, the linker can resolve some undefined references by linking
in functions from the assembler. The linker executables are named as follows:
- MicroBlaze and MicroBlaze™ -V
-
mb-ld - Cortex A9 cores
-
arm-none-eabi-ld - Cortex-A53 and Cortex-A72
-
aarch64-none-elf-ld - Cortex-R5F
-
armr5-none-eabi-ld
For details of each executable option, see the following sections:
- Commonly Used Compiler Options: Quick Reference
- Linker Options
- MicroBlaze Compiler Usage and Options
- MicroBlaze Linker Options
- Arm Compiler Usage and Options
Note: From this point forward, the
references to GCC in this chapter refer to the MicroBlaze and
MicroBlaze™
-V
compiler,
mb-gcc, and references to G++ refer to the
MicroBlaze C++ compiler, mb-g++.