ci: Build linux-aarch64 toolchains and host tools natively

This commit updates the CI workflow to build the linux-aarch64
toolchains and host tools natively on the ARM64 zephyr-runner in order
to reduce build time and any complexities related to cross compilation.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit is contained in:
Stephanos Ioannidis 2022-11-24 08:00:29 +09:00
parent c8e0448f01
commit 2e3c763fd3
1 changed files with 5 additions and 36 deletions

View File

@ -223,7 +223,7 @@ jobs:
if [ "${build_host_linux_aarch64}" == "y" ]; then
MATRIX_HOSTS+='{
"name": "linux-aarch64",
"runner": "zephyr-runner-linux-x64-4xlarge",
"runner": "zephyr-runner-linux-arm64-4xlarge",
"container": "ghcr.io/zephyrproject-rtos/sdk-build:v1.2.3",
"archive": "tar.xz"
},'
@ -416,12 +416,7 @@ jobs:
pkg-config texinfo p7zip
# Install dependencies for cross compilation
if [ "${{ matrix.host.name }}" == "linux-aarch64" ]; then
# Install aarch64-linux-gnu cross toolchain
sudo apt-get install -y binutils-aarch64-linux-gnu \
gcc-aarch64-linux-gnu \
g++-aarch64-linux-gnu
elif [ "${{ matrix.host.name }}" == "windows-x86_64" ]; then
if [ "${{ matrix.host.name }}" == "windows-x86_64" ]; then
# Install MinGW-w64 cross toolchain
sudo apt-get install -y binutils-mingw-w64 gcc-mingw-w64 \
g++-mingw-w64
@ -634,13 +629,7 @@ jobs:
EOF
# Set Canadian cross compilation configurations
if [ "${{ matrix.host.name }}" == "linux-aarch64" ]; then
# Building for linux-aarch64 on linux-x86_64
cat <<EOF >> .config
CT_CANADIAN=y
CT_HOST="aarch64-linux-gnu"
EOF
elif [ "${{ matrix.host.name }}" == "macos-aarch64" ]; then
if [ "${{ matrix.host.name }}" == "macos-aarch64" ]; then
# Building for macos-aarch64 on macos-x86_64
cat <<EOF >> .config
CT_CANADIAN=y
@ -660,18 +649,7 @@ jobs:
CT_GDB_CROSS_PYTHON_VARIANT=y
EOF
if [ "${{ matrix.host.name }}" == "linux-aarch64" ]; then
# Clone crosskit-aarch64-linux-libpython cross compilation kit
git clone \
https://github.com/stephanosio/crosskit-aarch64-linux-libpython.git \
${WORKSPACE}/crosskit-aarch64-linux-libpython
# Use Python 3.8.0
export LIBPYTHON_KIT_ROOT=${WORKSPACE}/crosskit-aarch64-linux-libpython/python-3.8.0
# Set Python configuration resolver for GDB
cat <<EOF >> .config
CT_GDB_CROSS_PYTHON_BINARY="${LIBPYTHON_KIT_ROOT}/bin/python"
EOF
elif [ "${{ matrix.host.name }}" == "macos-aarch64" ]; then
if [ "${{ matrix.host.name }}" == "macos-aarch64" ]; then
# Clone crosskit-aarch64-darwin-libpython cross compilation kit
git clone \
https://github.com/stephanosio/crosskit-aarch64-darwin-libpython.git \
@ -720,10 +698,7 @@ jobs:
popd
# Resolve output directory path
if [ "${{ matrix.host.name }}" == "linux-aarch64" ]; then
OUTPUT_BASE="${WORKSPACE}/output"
OUTPUT_DIR="HOST-aarch64-linux-gnu"
elif [ "${{ matrix.host.name }}" == "macos-aarch64" ]; then
if [ "${{ matrix.host.name }}" == "macos-aarch64" ]; then
OUTPUT_BASE="${WORKSPACE}/output"
OUTPUT_DIR="HOST-aarch64-apple-darwin"
elif [ "${{ matrix.host.name }}" == "windows-x86_64" ]; then
@ -903,12 +878,6 @@ jobs:
# Patch Poky sanity configuration to allow building as root
sed -i '/^INHERIT/ s/./#&/' poky/meta/conf/sanity.conf
# Resolve host machine type
if [ "${{ matrix.host.name }}" == "linux-aarch64" ]; then
# Cross compiling for AArch64 host on x86-64
export MACHINE="aarch64"
fi
# Build meta-zephyr-sdk
${POKY_BASE}/scripts/meta-zephyr-sdk-build.sh tools