Bookworm aarch64 cross compile docker
From embeddedTS Manuals
Debian provides cross compilers in their matching distribution. For example, if you are running Debian 12 on your workstation or VM:
sudo dpkg --add-architecture arm64
sudo apt-get update
# Cross compiler
sudo apt-get install gcc-aarch64-linux-gnu
# Install any needed libraries/headers from Debian 12 for arm64:
sudo apt-get install libc6-dev:arm64 libgpiod-dev:arm64
A hello world can be built with:
aarch64-linux-gnu-gcc hello.c -o hello
Tools like docker/cqfd can make this simpler to run Debian 12 in a container just for the build. See our cqfd hello world project that demonstrates a simpler way to run these from most Linux systems.