GnuArmToolchain » History » Version 1
steve-m, 02/19/2016 10:48 PM
add toolchain how-to
1 | 1 | steve-m | == GNU ARM toolchain == |
---|---|---|---|
2 | |||
3 | This page will describe the procedure for compiling a GNU ARM toolchain. |
||
4 | We will build a toolchain consisting of: |
||
5 | |||
6 | * GCC 4.5.2 |
||
7 | * Binutils 2.21 |
||
8 | * Newlib 1.19 |
||
9 | |||
10 | === Getting the buildscript === |
||
11 | |||
12 | First of all, create a directory you want to use for building the toolchain, and download the buildscript (gnu-arm-build.sh) attached to this page there. |
||
13 | |||
14 | === Dependencies === |
||
15 | |||
16 | In order to build the toolchain, you will need to install the following packages (assuming you're using a Debian-based distribution): |
||
17 | |||
18 | {{{ |
||
19 | $ sudo apt-get install build-essential libgmp3-dev libmpfr-dev libx11-6 libx11-dev texinfo flex bison libncurses5 \ |
||
20 | libncurses5-dbg libncurses5-dev libncursesw5 libncursesw5-dbg libncursesw5-dev zlibc libmpfr4 libmpfr-dev libmpc-dev |
||
21 | }}} |
||
22 | |||
23 | === Preparation === |
||
24 | |||
25 | Open a shell in the directory of gnu-arm-build.sh and create the following directories: |
||
26 | |||
27 | {{{ |
||
28 | $ mkdir build install src |
||
29 | }}} |
||
30 | |||
31 | Download the needed sources to src/: |
||
32 | |||
33 | {{{ |
||
34 | $ cd src/ |
||
35 | $ wget http://ftp.gnu.org/gnu/gcc/gcc-4.5.2/gcc-4.5.2.tar.bz2 |
||
36 | $ wget http://ftp.gnu.org/gnu/binutils/binutils-2.21.tar.bz2 |
||
37 | $ wget ftp://sources.redhat.com/pub/newlib/newlib-1.19.0.tar.gz |
||
38 | }}} |
||
39 | |||
40 | === Building the toolchain === |
||
41 | |||
42 | {{{ |
||
43 | $ cd .. |
||
44 | $ ./gnu-arm-build.sh |
||
45 | I will build an arm-elf cross-compiler: |
||
46 | |||
47 | Prefix: <YOURPATH>/install |
||
48 | Sources: <YOURPATH>/src |
||
49 | Build files: <YOURPATH>/build |
||
50 | |||
51 | Press ^C now if you do NOT want to do this. |
||
52 | }}} |
||
53 | |||
54 | Hit enter and after some time hopefully end up with: |
||
55 | |||
56 | {{{ |
||
57 | Build complete! Add <YOURPATH>/bin to your PATH to make arm-elf-gcc and friends |
||
58 | accessible directly. |
||
59 | }}} |
||
60 | |||
61 | === Making it accessible === |
||
62 | |||
63 | If you're using bash, you can add the following in your ~/.bashrc file: |
||
64 | |||
65 | {{{ |
||
66 | export PATH=$PATH:<YOURPATH>/install/bin |
||
67 | }}} |
||
68 | |||
69 | That's it. You can [GettingStarted#Gettingandupdatingthesource build] OsmocomBB now. |
||
70 | |||
71 | '''Credits:''' |
||
72 | |||
73 | This script is a slightly updated/modified version of http://hobbycode.googlecode.com/svn/trunk/gnu-arm-installer/[[BR]] |
||
74 | The original version also builds Insight, but since we don't need that, we won't build it. If you want to, just remove the comments in the shellscript. |