Toolchain Management
ELMOS integrates crosstool-ng for building native cross-compilers on macOS.
Overview
Section titled “Overview”Toolchains enable cross-compilation for target architectures without VMs. ELMOS supports pre-configured targets with optimized settings.
Supported Targets
Section titled “Supported Targets”| Target | Architecture | Description |
|---|---|---|
aarch64-unknown-linux-gnu |
ARM64 | 64-bit ARM |
arm-cortex_a15-linux-gnueabihf |
ARM | 32-bit ARM (Cortex-A15) |
riscv64-unknown-linux-gnu |
RISC-V | 64-bit RISC-V |
Commands
Section titled “Commands”Install crosstool-ng
Section titled “Install crosstool-ng”./build/elmos toolchains installClones and builds crosstool-ng to build/toolchains/crosstool-ng/.
List Targets
Section titled “List Targets”./build/elmos toolchains listShows available configurations.
Select Target
Section titled “Select Target”./build/elmos toolchains <target>Example: ./build/elmos toolchains riscv64-unknown-linux-gnu
Selection requires an initialized, mounted workspace and crosstool-ng. It writes the selected target’s configuration under the workspace toolchains directory. For the supported targets above, it also saves the matching ELMOS architecture. Other sample names are passed to crosstool-ng for validation.
Build Toolchain
Section titled “Build Toolchain”./build/elmos toolchains buildBuilds the selected toolchain (~30-60 min). Installs to build/toolchains/install/.
Check Status
Section titled “Check Status”./build/elmos toolchains statusVerifies installation and environment variables.
Show Environment
Section titled “Show Environment”./build/elmos toolchains envDisplays CROSS_COMPILE, PATH, etc.
Customize Config
Section titled “Customize Config”./build/elmos toolchains menuconfigInteractive configuration for advanced users.
Clean Artifacts
Section titled “Clean Artifacts”./build/elmos toolchains cleanRemoves build artifacts.
Automatic Detection
Section titled “Automatic Detection”Kernel, module, and app builds auto-detect installed toolchains based on selected architecture (./build/elmos arch <arch>).
Falls back to Homebrew LLVM if no toolchain installed.
Custom Toolchains
Section titled “Custom Toolchains”For custom targets, modify configs in assets/toolchains/configs/ and rebuild.
Troubleshooting
Section titled “Troubleshooting”- Build fails: Ensure all deps installed (
./build/elmos doctor) - Slow builds: Use more cores with
CT_PARALLEL_JOBSenv var - Conflicts: Clean and rebuild