Cross Compilation Environment
The SiMa DevKit comes pre-flashed with SiMa’s Yocto Linux, a build system designed for creating custom Linux distributions tailored to embedded systems.
Unlike Ubuntu, Yocto Linux does not include a package manager like apt
.
Developers can create custom Yocto builds by introducing their own recipes or use the SiMa-provided Yocto SDK to cross-compile applications and third-party components from source code.
For developers new to setting up a Yocto Linux build, it is still possible to build applications that run on the SiMa-provided Linux distribution.
To setup cross compilation environment, follow the steps below:
user@palette-container-id:/home/docker/{project}$ source /opt/poky/4.0.23/environment-setup-cortexa65-poky-linux
Note
The Yocto version may change from the above example when you update Palette.
This setup configures the build environment to use the right toolchain and libraries for cross-compilation. The following commands shows various tools such as CXX
and how they are configured:
user@palette-container-id:/home/docker/{project}$ env | grep -E 'CC|CXX|LD|SYSROOT|CROSS|TARGET'
OECORE_TUNE_CCARGS= -mcpu=cortex-a65 -march=armv8.2-a+crypto -mbranch-protection=standard -mabi=lp64
SDKTARGETSYSROOT=/opt/poky/4.0.23/sysroots/cortexa65-poky-linux
TARGET_PREFIX=aarch64-poky-linux-
OECORE_TARGET_OS=linux
CXX=aarch64-poky-linux-g++ -mcpu=cortex-a65 -march=armv8.2-a+crypto -mbranch-protection=standard -mabi=lp64 -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/opt/poky/4.0.23/sysroots/cortexa65-poky-linux
CXXFLAGS= -O2 -pipe -g -feliminate-unused-debug-types
OECORE_NATIVE_SYSROOT=/opt/poky/4.0.23/sysroots/x86_64-pokysdk-linux
LDFLAGS=-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-z,relro,-z,now
OECORE_TARGET_SYSROOT=/opt/poky/4.0.23/sysroots/cortexa65-poky-linux
LD=aarch64-poky-linux-ld --sysroot=/opt/poky/4.0.23/sysroots/cortexa65-poky-linux
OECORE_TARGET_ARCH=aarch64
PKG_CONFIG_SYSROOT_DIR=/opt/poky/4.0.23/sysroots/cortexa65-poky-linux
CC=aarch64-poky-linux-gcc -mcpu=cortex-a65 -march=armv8.2-a+crypto -mbranch-protection=standard -mabi=lp64 -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/opt/poky/4.0.23/sysroots/cortexa65-poky-linux
CROSS_COMPILE=aarch64-poky-linux-