Compiler Toolchain Support

The SDSoC™ environment uses the same GNU Arm® cross-compiler toolchains included with the Xilinx® Software Development Kit (SDK).

The Linaro-based GCC compiler toolchains support the Zynq®-7000 SoC and Zynq® UltraScale+™ MPSoC family devices. This section includes additional information on toolchain usage.

When compiling and linking applications, use only object files and libraries built using the same compiler toolchain and options as those used by the SDSoC environment. All SDSoC provided software libraries and software components (Linux kernel, root filesystem, BSP libraries, and other pre-built libraries) are built with the included toolchains. If you use sdscc/sds++ (referred to as sds++) to compile object files, the tools automatically insert a small number of options. If you invoke the underlying toolchains, you must use the same options.

For example, if you use a different Zynq-7000 floating-point application binary interface (ABI), your binary objects are incompatible and cannot be linked with SDSoC Zynq-7000 binary objects and libraries.

The following table summarizes the sds++ usage of Zynq-7000 toolchains and options. Where options are listed, you need to specify them only if you use the toolchain gcc and g++ commands directly instead of invoking sds++.

Table 1. sds++ Usage with Zynq-7000
Usage Description
Zynq-7000 Arm bare-metal compiler and linker options -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard
Zynq-7000 Arm bare-metal linker options -Wl,--build-id=none -specs=<specfile>

Where the <specfile> contains

*startfile:

crti%O%s crtbegin%O%s

Zynq-7000 Arm bare-metal compiler ${SDSOC_install}/SDK/gnu/aarch32/<host>/gcc-arm-none-eabi/bin

Toolchain prefix: arm-none-eabi

gcc executable: arm-none-eabi-gcc

g++ executable: arm-none-eabi-g++

Zynq-7000 SDSoC bare-metal software (lib, include) ${SDSOC_install}/aarch32-none
Zynq-7000 Arm Linux compiler ${SDSOC_install}/SDK/gnu/aarch32/<host>/gcc-arm-linux-gnueabi/bin

Toolchain prefix: arm-linux-gnueabihf-

gcc executable: arm-linux-gnueabihf-gcc

g++ executable: arm-linux-gnueabihf-g++

Zynq-7000 SDSoC Linux software (lib, include) ${SDSOC_install}/aarch32-linux

The following table summarizes sds++ usage of Zynq UltraScale+ MPSoC Cortex™-A53 toolchains and options. Where options are listed, you only need to specify them if you use the toolchain gcc and g++ commands directly instead of invoking sds++.

Table 2. sds++ Usage with Zynq UltraScale+ MPSoC Cortex-A53
Usage Description
Zynq UltraScale+ MPSoC Arm bare-metal compiler and linker options -mcpu=cortex-a53 -DARMR5 -mfloat-abi=hard -mfpu=vfpv3-d16
Zynq UltraScale+ MPSoC Arm bare-metal linker options -Wl,--build-id=none
Zynq UltraScale+ MPSoC Arm bare-metal compiler ${SDSOC_install}/SDK/gnu/aarch64/<host>/aarch64-none/bin

Toolchain prefix: aarch64-none-elf

gcc executable: aarch64-none-elf-gcc

g++ executable: aarch64-none-elf-g++

Zynq UltraScale+ MPSoC SDSoC bare-metal software (lib, include) ${SDSOC_install}/aarch64-none
Zynq UltraScale+ MPSoC Arm Linux compiler ${SDSOC_install}/SDK/gnu/aarch64/<host>/aarch64-linux/bin

Toolchain prefix: aarch64-linux-gnu-

gcc executable: aarch64-linux-gnu-gcc

g++ executable: aarch64-linux-gnu-g++

Zynq UltraScale+ MPSoC SDSoC Linux software (lib, include) ${SDSOC_install}/aarch64-linux

The following table summarizes the sds++ usage of Zynq® UltraScale+™ MPSoC Cortex-R5 toolchains and options. Where options are listed, you need to specify them only if you use the toolchain gcc and g++ commands directly instead of invoking sds++.

Table 3. sds++ Usage with Zynq UltraScale+ MPSoC Cortex-R5
Usage Description
Zynq UltraScale+ MPSoC Arm bare-metal compiler and linker options -mcpu=cortex-r5 -DARMR5 -mfloat-abi=hard -mfpu=vfpv3-d16
Zynq UltraScale+ MPSoC Arm bare-metal linker options -Wl,--build-id=none
Zynq UltraScale+ MPSoC Arm bare-metal compiler ${SDSOC_install)/SDK/gnu/armr5/<host>/gcc-arm-none-eabi/bin

Toolchain prefix: armr5-none-eabi

gcc executable: armr5-none-eabi-gcc

g++ executable: armr5-none-eabi-g++

Zynq UltraScale+ MPSoC SDSoC bare-metal software (lib, include) ${SDSoC_install}/armr5-none
IMPORTANT!: When using sds++ to compile Zynq-7000 source files, be aware that SDSoC tools that are processing and analyzing source files issue errors if they contain NEON instrinsics. If hardware accelerator (or caller) source files contain NEON intrinsics, guard them using the __SDSCC__ and __SDSVHLS__ macros.

For source files that do not contain hardware accelerators or callers but do use NEON intrinsics, you can either compile them directly using the GNU toolchain and link the objects with sds++, or you can add the sds++ command line option -mno-ir for these source files. This option prevents clang-based tools from being invoked to create an intermediate representation (IR) used in analysis. You are programmatically aware that they are not required (such as no accelerators or callers).

For the latter solution, if you are using the SDSoC environment, you can apply the option on a per-file basis by right-clicking the source file, select Properties and go to the Settings dialog box under C/C++ Build Settings > Settings.

Figure: Build Settings