Toolchain » History » Version 24
fixeria, 06/12/2024 10:58 AM
separate Debian and Arch, update versions, add notes about arm-none-eabi-gcc 14.1.0
1 | 12 | fixeria | h1. Toolchain |
---|---|---|---|
2 | 1 | tsaitgaist | |
3 | 23 | fixeria | {{>toc}} |
4 | |||
5 | 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. |
6 | 5 | tsaitgaist | |
7 | 20 | fixeria | h3. Binary packages |
8 | 1 | tsaitgaist | |
9 | 12 | fixeria | You can use a pre-compiled toolchain provided by your GNU/Linux distribution. |
10 | 1 | tsaitgaist | |
11 | 24 | fixeria | h4. Debian / Ubuntu |
12 | |||
13 | 12 | fixeria | For Debian based distributions (Ubuntu, Linux Mint, etc.), use the following command: |
14 | 1 | tsaitgaist | |
15 | 12 | fixeria | <pre> |
16 | $ sudo apt install gcc-arm-none-eabi |
||
17 | 1 | tsaitgaist | </pre> |
18 | |||
19 | 24 | fixeria | The following version is known to work: |
20 | 11 | tsaitgaist | |
21 | 1 | tsaitgaist | <pre> |
22 | 24 | fixeria | Package: gcc-arm-none-eabi |
23 | Version: 15:12.2.rel1-1 |
||
24 | </pre> |
||
25 | |||
26 | h4. ArchLinux |
||
27 | |||
28 | For ArchLinux (and Manjaro), use the following command: |
||
29 | |||
30 | <pre> |
||
31 | 20 | fixeria | $ sudo pacman -S arm-none-eabi-gcc arm-none-eabi-newlib |
32 | 1 | tsaitgaist | </pre> |
33 | 20 | fixeria | |
34 | The following versions are confirmed to work: |
||
35 | |||
36 | 1 | tsaitgaist | <pre> |
37 | 20 | fixeria | Name : arm-none-eabi-gcc |
38 | 24 | fixeria | Version : 13.2.0-2 |
39 | 20 | fixeria | --- |
40 | 1 | tsaitgaist | Name : arm-none-eabi-binutils |
41 | 24 | fixeria | Version : 2.42-1 |
42 | 1 | tsaitgaist | --- |
43 | Name : arm-none-eabi-newlib |
||
44 | 24 | fixeria | Version : 4.4.0.20231231-1 |
45 | 1 | tsaitgaist | </pre> |
46 | 24 | fixeria | |
47 | Unfortunately, the firmware does not compile with a more recent arm-none-eabi-gcc (see #6487): |
||
48 | |||
49 | <pre> |
||
50 | Name : arm-none-eabi-gcc |
||
51 | Version : 14.1.0-1 |
||
52 | </pre> |
||
53 | |||
54 | As a temporary solution, you can either downgrade this package or use Debian's one (in Docker). |
||
55 | 17 | fixeria | |
56 | 20 | fixeria | h3. Building from source |
57 | |||
58 | 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]]. |
||
59 | 17 | fixeria | |
60 | h3. Building old branches |
||
61 | |||
62 | 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. |
63 | 1 | tsaitgaist | |
64 | 21 | fixeria | This combination is known to work: |
65 | |||
66 | * binutils 2.21.1a, |
||
67 | * newlib 1.19.0, |
||
68 | * gcc 4.8.2. |
||
69 | |||
70 | 22 | laforge | It can be compiled using our "Dockerfiles":https://gitea.osmocom.org/osmocom/docker-playground: |
71 | 21 | fixeria | |
72 | <pre> |
||
73 | 22 | laforge | $ git clone https://gitea.osmocom.org/osmocom/docker-playground |
74 | 21 | fixeria | $ cd docker-playground/arm-none-eabi-gcc-4.8.2 |
75 | $ make |
||
76 | </pre> |
||
77 | |||
78 | Usage example: |
||
79 | |||
80 | <pre> |
||
81 | $ cd osmocom-bb |
||
82 | $ docker run --user $(id -u) -v $(pwd):/data -it --rm root/arm-none-eabi-gcc-4.8.2 |
||
83 | # cd /data/src |
||
84 | # make firmware |
||
85 | </pre> |
||
86 | 17 | fixeria | |
87 | 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. |
||
88 | This issue has been fixed in master: http://cgit.osmocom.org/osmocom-bb/commit/?id=a903b3c1ee27047c79728b18ff6340d23d1aad2e. |
||
89 | |||
90 | 1 | tsaitgaist | h3. Mac OS X |
91 | |||
92 | 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. |