Toolchain » History » Version 17
fixeria, 05/11/2019 01:20 AM
1 | 12 | fixeria | h1. Toolchain |
---|---|---|---|
2 | 1 | tsaitgaist | |
3 | 12 | fixeria | To compile the target firmware for [[OsmocomBB]] or [[SIMtrace:]], you need a GNU Toolchain for ARM. There are various pre-compiled toolchains available, 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 | 12 | fixeria | h3. Binary distribution |
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 | $ sudo pacman -S arm-none-eabi-gcc |
||
19 | </pre> |
||
20 | 11 | tsaitgaist | |
21 | 17 | fixeria | h3. Build one from source |
22 | |||
23 | If you want to build your own toolchain, known to be working with [[OsmocomBB]], see here: [[GnuArmToolchain]]. |
||
24 | |||
25 | This is the best option to get a fairly recent GCC, and this is the option used by several [[OsmocomBB]] developers. |
||
26 | |||
27 | h3. Building old branches |
||
28 | |||
29 | 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. |
||
30 | |||
31 | Please follow the build instructions at: https://github.com/axilirator/gnu-arm-installer/ |
||
32 | |||
33 | 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. |
||
34 | This issue has been fixed in master: http://cgit.osmocom.org/osmocom-bb/commit/?id=a903b3c1ee27047c79728b18ff6340d23d1aad2e. |
||
35 | |||
36 | 16 | fixeria | h3. Build in Docker (dockcross) |
37 | |||
38 | Please refer: https://github.com/dockcross/dockcross |
||
39 | |||
40 | <pre> |
||
41 | 12 | fixeria | $ git clone https://github.com/dockcross/dockcross |
42 | 1 | tsaitgaist | $ cd dockcross/ |
43 | 6 | tsaitgaist | $ mkdir build/ |
44 | 12 | fixeria | $ docker run --rm dockcross/linux-armv7 > build/dockcross |
45 | $ chmod +x build/dockcross |
||
46 | 13 | fixeria | </pre> |
47 | 1 | tsaitgaist | |
48 | 17 | fixeria | Unfortunately, *I didn't (yet) manage to build the firmware using this toolchain*. Here is what I tried: |
49 | 14 | fixeria | |
50 | 1 | tsaitgaist | <pre> |
51 | $ cd osmocom-bb/src/ |
||
52 | 15 | fixeria | $ $HOME/dockcross/build/dockcross make firmware |
53 | </pre> |
||
54 | |||
55 | 13 | fixeria | If you know how to proceed, please update this section. |
56 | 12 | fixeria | |
57 | 1 | tsaitgaist | h3. Mac OS X |
58 | |||
59 | 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. |