The official cross-compilation toolchain for building native Linux applications on PocketAIS.
PocketAIS is an RK3562-based handheld device running AisOS, a Rocknix-derived Linux distribution. This repository ships the prebuilt C/C++ cross toolchains that let you compile native ARM binaries (applications, libraries, and services) that run directly on the device — no emulator, no container required.
With this toolchain you can build everything from a small command-line utility to a full SDL2/OpenGL ES game or a Python extension module, exactly the way the stock AisOS system libraries are built.
| Directory | Target triple | ABI | Use it for |
|---|---|---|---|
toolchain_r |
aarch64-rocknix-linux-gnueabi |
64-bit ARM | Modern PocketAIS apps (recommended default) |
toolchain_r_32 |
armv8a-rocknix-linux-gnueabi |
32-bit ARM | 32-bit-only targets / legacy binaries |
Each directory is a self-contained, relocatable toolchain (compiler, binutils, headers and a full sysroot with the device's system libraries). You do not need to install anything else on your build machine besides the toolchain itself.
Note on repository size. The two toolchain directories contain a complete compiler + sysroot and are large. They are committed as ordinary files so the repo is self-contained; if you prefer to keep the Git repo light, you can instead publish them as release tarballs / Git LFS and point developers here for the download instructions.
| Component | Version (both toolchains) |
|---|---|
| GCC | 14.2.0 |
| LLVM / Clang | 19 |
| C library | glibc (sysroot) |
| binutils / ld | GNU linker (bfd + gold) |
| Languages | C, C++, Objective-C, Fortran (where applicable) |
The cross-compilers are Linux x86_64 binaries. To run them your build machine needs:
- A 64-bit Linux distribution (x86_64 / amd64).
- glibc ≥ 2.32 on the build host (e.g. Ubuntu 20.04+, Debian 11+, Fedora 33+).
The compiler binaries themselves link against the host glibc, so an older host
glibc will fail with
version 'GLIBC_2.32' not found. ccache(optional but recommended — see Troubleshooting).
Windows / macOS users: build inside WSL2, a Linux VM, or a Linux container. The toolchains are not native Windows/macOS binaries.
git clone https://github.com/gamely-code/retrohandle_toolchain.git
cd retrohandle_toolchainFor the 64-bit toolchain (recommended):
export TC=$PWD/toolchain_r
export PATH=$TC/bin:$PATH
export SYSROOT=$TC/aarch64-rocknix-linux-gnueabi/sysrootFor the 32-bit toolchain:
export TC=$PWD/toolchain_r_32
export PATH=$TC/bin:$PATH
export SYSROOT=$TC # headers/libs live at the toolchain root for the 32-bit build(To find the exact configured sysroot at any time, run
aarch64-rocknix-linux-gnueabi-gcc -print-sysroot.)
hello.c:
#include <stdio.h>
int main(void) {
printf("Hello from PocketAIS!\n");
return 0;
}aarch64-rocknix-linux-gnueabi-gcc --sysroot=$SYSROOT hello.c -o hello
file hello # => ELF 64-bit LSB executable, ARM aarch64Copy hello to the device (via scp/ADB/SD card) and run it from a shell.
A C++ example works the same way with the matching g++:
aarch64-rocknix-linux-gnueabi-g++ --sysroot=$SYSROOT hello.cpp -o helloCreate a toolchain file (example: aarch64-rocknix.cmake):
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
# Point this at the toolchain_r directory you cloned.
set(TOOLCHAIN_DIR "$ENV{TOOLCHAIN_DIR}")
set(CMAKE_C_COMPILER ${TOOLCHAIN_DIR}/bin/aarch64-rocknix-linux-gnueabi-gcc)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_DIR}/bin/aarch64-rocknix-linux-gnueabi-g++)
set(CMAKE_SYSROOT ${TOOLCHAIN_DIR}/aarch64-rocknix-linux-gnueabi/sysroot)
# Search for programs on the host, but libraries/headers only in the sysroot.
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)Then configure and build:
export TOOLCHAIN_DIR=$PWD/toolchain_r
cmake -B build -DCMAKE_TOOLCHAIN_FILE=aarch64-rocknix.cmake
cmake --build buildFor the 32-bit target, use armv8a-rocknix-linux-gnueabi-gcc/g++ and set
CMAKE_SYSROOT to $TOOLCHAIN_DIR (the 32-bit sysroot is at the toolchain root).
The sysroot already ships the system libraries AisOS uses, so you can link against them out of the box (header search and library search default into the sysroot):
- Graphics / display: SDL2, Wayland (
libwayland-client/-cursor/-server+ protocols), GBM, libdrm, OpenGL ES (libGLESv2), EGL (Mesa), Vulkan (Panfrost driver) - Audio: OpenAL
- Scripting: Python 3.11 (headers +
libpython3.11) - Networking / crypto: OpenSSL (
libssl/libcrypto), cURL - Compression / data: zlib, zstd, liblzma (xz), libxml2, expat
- System / base: glib / GObject / GIO, gettext, pcre2, ncurses, X11 / xcb, GMP / MPFR
To use a library, just #include its header and add -l<name> at link time, e.g.:
aarch64-rocknix-linux-gnueabi-gcc --sysroot=$SYSROOT app.c -lSDL2 -lGLESv2 -o appUse toolchain_r (aarch64, 64-bit) unless you have a specific reason not to.
It is the native word size of the RK3562 and what AisOS user-space is built for.
Use toolchain_r_32 (armv8a, 32-bit) only when you must produce 32-bit ARM
binaries — for example to interoperate with a 32-bit-only component, or to reuse
existing 32-bit ARM code/libraries.
retrohandle_toolchain/
├── README.md # this file
├── toolchain_r/ # aarch64 (64-bit) toolchain
│ ├── bin/ # prefixed compilers & tools (aarch64-rocknix-linux-gnueabi-*)
│ ├── include/ # toolchain headers
│ └── aarch64-rocknix-linux-gnueabi/
│ └── sysroot/ # target sysroot (usr/lib, usr/include, ...)
└── toolchain_r_32/ # armv8a (32-bit) toolchain
├── bin/ # prefixed compilers & tools (armv8a-rocknix-linux-gnueabi-*)
├── include/ # sysroot headers (at toolchain root for the 32-bit build)
└── lib/ # sysroot libraries
aarch64-rocknix-linux-gnueabi-gcc: .../ccache: No such file or directory
The gcc/g++ entries are thin ccache wrappers whose path was baked in at build
time. On your machine either:
- install
ccacheand recreate the wrapper so it callsccachefrom yourPATH, or - simply invoke the real compiler directly:
aarch64-rocknix-linux-gnueabi-gcc-14.2.0/armv8a-rocknix-linux-gnueabi-gcc-14.2.0.
version 'GLIBC_2.32' not found
Your build host is too old. Use a Linux distribution with glibc ≥ 2.32, or build
inside a container / WSL2 based on a current distro.
Header / library not found
Make sure you pass --sysroot=$SYSROOT (or set CMAKE_SYSROOT in CMake) and that
you are using the prefixed compiler, never your host gcc.
The toolchain binaries are redistributed under the licenses of their respective
upstream projects (GCC, LLVM, glibc, binutils, and the bundled system libraries).
See each component's share/doc/*/COPYING / share/licenses inside the toolchain
directories for the exact terms.
⚠️ A top-levelLICENSEfile for this repository's own documentation/scripts has not been added yet — please choose and commit one before the public release.
This repository distributes prebuilt toolchains; it is not built from source here. To report an issue or request an updated/broader toolchain, please open an issue on the project tracker.