Project

General

Profile

Toolchain » History » Version 21

fixeria, 04/18/2022 12:36 PM
Describe building the old toolchain using Docker

1 12 fixeria
h1. Toolchain
2 1 tsaitgaist
3 20 fixeria
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.
4 5 tsaitgaist
5 20 fixeria
h3. Binary packages
6 1 tsaitgaist
7 12 fixeria
You can use a pre-compiled toolchain provided by your GNU/Linux distribution.
8 1 tsaitgaist
9 12 fixeria
For Debian based distributions (Ubuntu, Linux Mint, etc.), use the following command:
10 1 tsaitgaist
11 12 fixeria
<pre>
12
$ sudo apt install gcc-arm-none-eabi
13
</pre>
14 1 tsaitgaist
15 12 fixeria
For ArchLinux (https://www.archlinux.org/packages/community/x86_64/arm-none-eabi-gcc/):
16 11 tsaitgaist
17 12 fixeria
<pre>
18 19 fixeria
$ sudo pacman -S arm-none-eabi-gcc arm-none-eabi-newlib
19 12 fixeria
</pre>
20 1 tsaitgaist
21 20 fixeria
The following versions are confirmed to work:
22 1 tsaitgaist
23 20 fixeria
<pre>
24
Name            : arm-none-eabi-gcc
25
Version         : 10.2.0-1
26
---
27
Name            : arm-none-eabi-binutils
28
Version         : 2.34-1
29
---
30
Name            : arm-none-eabi-newlib
31
Version         : 3.3.0-1
32
</pre>
33 17 fixeria
34 20 fixeria
h3. Building from source
35
36
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]].
37 17 fixeria
38
h3. Building old branches
39
40 21 fixeria
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.
41 1 tsaitgaist
42 21 fixeria
This combination is known to work:
43
44
* binutils 2.21.1a,
45
* newlib 1.19.0,
46
* gcc 4.8.2.
47
48
It can be compiled using our "Dockerfiles":https://cgit.osmocom.org/docker-playground/:
49
50
<pre>
51
$ git clone https://git.osmocom.org/docker-playground
52
$ cd docker-playground/arm-none-eabi-gcc-4.8.2
53
$ make
54
</pre>
55
56
Usage example:
57
58
<pre>
59
$ cd osmocom-bb
60
$ docker run --user $(id -u) -v $(pwd):/data -it --rm root/arm-none-eabi-gcc-4.8.2
61
# cd /data/src
62
# make firmware
63
</pre>
64 17 fixeria
65
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.
66
This issue has been fixed in master: http://cgit.osmocom.org/osmocom-bb/commit/?id=a903b3c1ee27047c79728b18ff6340d23d1aad2e.
67
68 1 tsaitgaist
h3. Mac OS X
69
70 17 fixeria
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.
Add picture from clipboard (Maximum size: 48.8 MB)