Setup Guide for Development Environment on Linux for LLVM/Clang
Table of Contents
Install Basic Tools and Dependencies
First, update your package manager and install essential tools required for building and managing software projects:
sudo apt-get update -y && sudo apt-get -y install git wget make python3 zip unzip python-is-python3
Install CMake
Download CMake 4.1.2 for Linux. CMake is vital for configuring, generating, and managing build processes in a platform-independent manner:
wget https://github.com/Kitware/CMake/releases/download/v4.1.2/cmake-4.1.2-linux-x86_64.sh
sudo bash ./cmake-4.1.2-linux-x86_64.sh --skip-license --exclude-subdir --prefix=/usr/local
Install Ninja Build System
Ninja is a small build system with a focus on speed, which CMake can utilize to manage builds:
wget https://github.com/ninja-build/ninja/releases/download/v1.13.1/ninja-linux.zip
unzip ninja-linux.zip
mkdir /opt/ninja
mkdir /opt/ninja/bin
sudo cp ninja /opt/ninja/bin/
sudo chmod a+x /opt/ninja/bin/*
Add Ninja to PATH:
export PATH=/opt/ninja/bin:$PATH
Make it permanent:
echo 'export PATH=/opt/ninja/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
Install Python
Python 3.13.x or newer is required to run configuration tools (menuconfig, kconfig) and to execute scripts used during SDK build and setup.
Choose one of the options below:
Option A: System Python (if already 3.13.x+)
python3 --version
Option B: pyenv (recommended if you need to install Python 3.13.x)
sudo apt update
sudo apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev \
libnss3-dev libssl-dev libreadline-dev libffi-dev wget curl
curl https://pyenv.run | bash
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
pyenv install 3.13.7
pyenv local 3.13.7
python3 --version
Optional: make pyenv available in future shells (skip this if you prefer to enable pyenv manually per shell):
echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
If you chose the optional lines above, restart your shell or run source ~/.bashrc to apply them.
Install the Arm GNU Toolchain
wget -O gcc-arm-none-eabi.tar.xz https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz
mkdir -p /opt/gcc-arm-none-eabi
sudo apt-get -y install xz-utils tar
tar -xf gcc-arm-none-eabi.tar.xz --strip-components=1 -C /opt/gcc-arm-none-eabi
export PATH=/opt/gcc-arm-none-eabi/bin:$PATH
export GCC_TOOLCHAIN_ROOT=/opt/gcc-arm-none-eabi
Make it permanent:
echo 'export PATH=/opt/gcc-arm-none-eabi/bin:$PATH' >> ~/.bashrc
echo 'export GCC_TOOLCHAIN_ROOT=/opt/gcc-arm-none-eabi' >> ~/.bashrc
source ~/.bashrc
Note: LLVM builds require GCC_TOOLCHAIN_ROOT for the GCC sysroot and libstdc++.
Install the LLVM Toolchain
The SDK expects LLVM_TOOLCHAIN_ROOT to point to a directory that contains at least:
clangclang++ld.lldllvm-arllvm-ranlibllvm-objcopy
x86_64 hosts
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 21
sudo mkdir -p /opt/llvm/bin
for tool in clang clang++ llvm-ar llvm-nm llvm-objcopy llvm-objdump llvm-ranlib llvm-readelf llvm-size llvm-strip llvm-addr2line lld ld.lld; do
sudo ln -sf "/usr/bin/${tool}-21" "/opt/llvm/bin/${tool}"
done
export PATH=/opt/llvm/bin:$PATH
export LLVM_TOOLCHAIN_ROOT=/opt/llvm/bin
aarch64 / arm64 hosts
On ARM Linux hosts, apt.llvm.org may not provide the required binaries. Use distro packages instead:
sudo apt-get update -y
sudo apt-get install -y clang-21 lldb-21 lld-21 llvm-21
sudo mkdir -p /opt/llvm/bin
for tool in clang clang++ llvm-ar llvm-nm llvm-objcopy llvm-objdump llvm-ranlib llvm-readelf llvm-size llvm-strip llvm-addr2line lld ld.lld; do
sudo ln -sf "/usr/bin/${tool}-21" "/opt/llvm/bin/${tool}"
done
export PATH=/opt/llvm/bin:$PATH
export LLVM_TOOLCHAIN_ROOT=/opt/llvm/bin
If versioned LLVM 21 packages are not available on your ARM distribution, install the default packages and update the symlinks accordingly:
sudo apt-get update -y
sudo apt-get install -y clang lldb lld llvm
sudo mkdir -p /opt/llvm/bin
for tool in clang clang++ llvm-ar llvm-nm llvm-objcopy llvm-objdump llvm-ranlib llvm-readelf llvm-size llvm-strip llvm-addr2line lld ld.lld; do
sudo ln -sf "/usr/bin/${tool}" "/opt/llvm/bin/${tool}"
done
export PATH=/opt/llvm/bin:$PATH
export LLVM_TOOLCHAIN_ROOT=/opt/llvm/bin
Verify the installation:
clang --version
ld.lld --version
llvm-ar --version
llvm-objcopy --version
Make it permanent:
echo 'export PATH=/opt/llvm/bin:$PATH' >> ~/.bashrc
echo 'export LLVM_TOOLCHAIN_ROOT=/opt/llvm/bin' >> ~/.bashrc
source ~/.bashrc
Install OpenOCD
sudo apt-get update
sudo apt-get install -y openocd
openocd --version
Debug Steps
For debug capabilities - download debian file of Ozone debugger from: Ozone Debugger
Then install it using the commands below:
sudo apt install build-essential
sudo dpkg --install Ozone_Linux_V334_x86_64.deb
Note: LLVM compiler support is currently available only for SR110.