Cross Compilation Support

The YumaPro code can be cross-compiled on many different platforms.

This page collects notes and examples for common cross-compile environments. For the full list of build variables, see YumaPro README.

Cross-Compiling for PetaLinux

PetaLinux Overview

The PetaLinux toolkit can be used to build YumaPro from source for Xilinx target boards.

PetaLinux installation and SDK setup is out of scope. This section assumes the SDK is correctly installed and that you source the PetaLinux environment scripts in the same shell used to run 'make'.

In the examples below the 'aarch64-xilinx-linux' target is used.

Example

make INC_PREFIX=/opt/SDK/sysroots/aarch64-xilinx-linux/usr/include \
     YP_SYSROOT=/opt/SDK/sysroots/aarch64-xilinx-linux \
     CROSS_TARGET=aarch64-xilinx-linux- \
     EXTRA_CFLAGS="-march=armv8-a+crc -mtune=cortex-a72.cortex-a53" \
     HOST=aarch64-xilinx-linux \
     PRODUCTION=1 TIMER_MONO_CLOCK=1 WITH_CLI=1 WITH_YCONTROL=1

Make Parameters for PetaLinux Cross-Compiling

Mandatory parameters:

  • CROSS_TARGET: toolchain prefix (e.g., aarch64-xilinx-linux-)

  • HOST: standard cross-compile variable; must match the toolchain target

  • YP_SYSROOT: sysroot passed to the compiler/linker (--sysroot=...)

  • INC_PREFIX: base include path for built-in header searches

Optional parameters:

  • EXTRA_CFLAGS: extra compiler flags appended to CFLAGS/CPPFLAGS

Other make parameters unrelated to cross-compiling are allowed; the parameter order should not matter.

Troubleshooting: SIGBUS on 32-bit ARM (NO_YPACK)

Some 32-bit ARM compilers do not handle alignment of packed structures correctly. This can cause the server to crash with a bus alignment error (SIGBUS / Bus error).

If this happens, disable packed data structures by using NO_YPACK=1 when building the server.

Example:

make NO_YPACK=1 \
     DESTDIR=/home/lab/cross_compile/cross_build/release/NETCONF \
     INC_PREFIX=/opt/toolchains/crosstools-arm-gcc-9.2-linux-4.19-glibc-2.30-binutils-2.32/include \
     HOST=arm-buildroot-linux-gnueabi \
     CROSS_TARGET=/opt/toolchains/crosstools-arm-gcc-9.2-linux-4.19-glibc-2.30-binutils-2.32/usr/bin/arm-buildroot-linux-gnueabi- \
     YP_SYSROOT=/opt/toolchains/crosstools-arm-gcc-9.2-linux-4.19-glibc-2.30-binutils-2.32/arm-buildroot-linux-gnueabi/sysroot \
     USER_INC="-I${RELEASE_HOME}/openssl/include -I${RELEASE_HOME}/libxml2/include -I${RELEASE_HOME}/libxml2/include/libxml2 -I${RELEASE_HOME}/libxml2/include/libxml2/libxml -I${RELEASE_HOME}/zlib/include" \
     USER_LIB="-L${RELEASE_HOME}/openssl/lib -L${RELEASE_HOME}/libxml2/lib -L${RELEASE_HOME}/zlib/lib" \
     DEBUG=1 DEBUG2=1

For Yocto-based builds, see Build For Yocto Linux.