Toolchain¶
- Table of contents
- Toolchain
To compile the target firmware for OsmocomBB or SIMtrace, you need a GNU toolchain for ARM. You can either use binary packages provided by your distribution (recommended), or build a toolchain from source code yourself. There are various pre-compiled toolchains available (e.g. Code Sourcery), but not all of them will produce working firmware. We're trying to support all these configurations, but it might take a while to identify the source of a problem. If you have persistent errors when compiling, try using a different package.
Binary packages¶
You can use a pre-compiled toolchain provided by your GNU/Linux distribution.
Debian / Ubuntu¶
For Debian based distributions (Ubuntu, Linux Mint, etc.), use the following command:
$ sudo apt install gcc-arm-none-eabi
The following version is known to work:
Package: gcc-arm-none-eabi Version: 15:12.2.rel1-1
ArchLinux¶
For ArchLinux (and Manjaro), use the following command:
$ sudo pacman -S arm-none-eabi-gcc arm-none-eabi-newlib
The following versions are confirmed to work:
Name : arm-none-eabi-gcc Version : 13.2.0-2 --- Name : arm-none-eabi-binutils Version : 2.42-1 --- Name : arm-none-eabi-newlib Version : 4.4.0.20231231-1
Unfortunately, the firmware does not compile with a more recent arm-none-eabi-gcc (see #6487):
Name : arm-none-eabi-gcc Version : 14.1.0-1
As a temporary solution, you can either downgrade this package or use Debian's one (in Docker).
Building from source¶
If a pre-compiled toolchain provided by your distribution fails to produce working firmware images, you can build your own toolchain known to be working with OsmocomBB, see here: GnuArmToolchain.
Building old branches¶
If you need to build the firmware from old unmaintained branches (sylvain/burst_ind, sylvain/testing, jolly/testing, etc.), an older version of toolchain is needed.
This combination is known to work:
- binutils 2.21.1a,
- newlib 1.19.0,
- gcc 4.8.2.
It can be compiled using our Dockerfiles:
$ git clone https://gitea.osmocom.org/osmocom/docker-playground $ cd docker-playground/arm-none-eabi-gcc-4.8.2 $ make
Usage example:
$ cd osmocom-bb $ docker run --user $(id -u) -v $(pwd):/data -it --rm root/arm-none-eabi-gcc-4.8.2 # cd /data/src # make firmware
When using toolchain with GCC >=4.8, the firmware can be compiled, but will hang as soon as you want to sync to an ARFCN.
This issue has been fixed in master: http://cgit.osmocom.org/osmocom-bb/commit/?id=a903b3c1ee27047c79728b18ff6340d23d1aad2e.
Mac OS X¶
Apparently the arm-elf-gcc 4.3.2 from ports for MacOS X can compile the firmware as well after symlinking /opt/local/bin/arm-elf-ranlib to /opt/local/bin/arm-elf-linux-ranlib and /opt/local/bin/arm-elf-strip to /opt/local/bin/arm-elf-linux-strip. If you omit the links, there will be unresolvable references to symbols in the libraries.
Updated by fixeria 18 days ago · 24 revisions