Compiler Framework - 2024.1 English

Vitis Unified Software Platform Documentation: Embedded Software Development (UG1400)

Document ID
UG1400
Release Date
2024-05-30
Version
2024.1 English

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 are named as follows:
  • mb-gcc for MicroBlaze and MicroBlaze™ -V
  • arm-none-eabi-gcc for Cortex A9 cores
  • aarch64-none-elf-gcc for Cortex-A53 and Cortex-A72
  • armr5-none-eabi-gcc for Cortex-R5F

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.
Assembler
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 named as follows:
  • mb-as for MicroBlaze and MicroBlaze™ -V
  • arm-none-eabi-as for Cortex A9 cores
  • aarch64-none-elf-as for Cortex-A53 and Cortex-A72
  • armr5-none-eabi-as for Cortex-R5F
Linker
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 executables named as follows:
  • mb-ld for MicroBlaze
  • arm-none-eabi-ld for Cortex A9 cores
  • aarch64-none-elf-ld for Cortex-A53and Cortex-A72
  • armr5-none-eabi-ld for Cortex-R5F

Executable options are described in the following sections:

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++.