Project

General

Profile

GnuArmToolchain » History » Version 14

laforge, 01/15/2017 09:34 AM

1 1 steve-m
2 13 ahuemer
h2. GNU ARM toolchain
3
4
5 1 steve-m
This page will describe the procedure for compiling a GNU ARM toolchain.
6
We will build a toolchain consisting of:
7 12 ahuemer
8 13 ahuemer
* GCC 4.8.2
9
* Binutils 2.21.1
10
* Newlib 1.19
11 1 steve-m
12
13 13 ahuemer
h3. Getting the buildscript
14
15
16 1 steve-m
First of all, create a directory you want to use for building the toolchain, and download the buildscript [raw-attachment:gnu-arm-build.3.sh] there.
17
You will need to make it executable:
18
19 13 ahuemer
<pre>
20 1 steve-m
$ chmod +x gnu-arm-build.3.sh
21 13 ahuemer
</pre>
22 1 steve-m
23
24 13 ahuemer
h3. Dependencies
25
26
27 1 steve-m
In order to build the toolchain, you will need to install the following packages (assuming you're using a Debian-based distribution):
28
29 13 ahuemer
<pre>
30 10 vogelchr
$ sudo apt-get install build-essential libgmp3-dev libmpfr-dev libx11-6 libx11-dev texinfo flex bison libncurses5 \
31 1 steve-m
  libncurses5-dbg libncurses5-dev libncursesw5 libncursesw5-dbg libncursesw5-dev zlibc zlib1g-dev libmpfr4 libmpc-dev
32 13 ahuemer
</pre>
33 1 steve-m
34
35 13 ahuemer
h3. Preparation
36
37
38 1 steve-m
Open a shell in the directory of gnu-arm-build.sh and create the following directories:
39
40 13 ahuemer
<pre>
41 1 steve-m
$ mkdir build install src
42 13 ahuemer
</pre>
43 1 steve-m
44
Download the needed sources to src/:
45
46 13 ahuemer
<pre>
47 6 steve-m
$ cd src/
48 1 steve-m
$ wget http://ftp.gnu.org/gnu/gcc/gcc-4.8.2/gcc-4.8.2.tar.bz2
49
$ wget http://ftp.gnu.org/gnu/binutils/binutils-2.21.1a.tar.bz2
50
$ wget ftp://sources.redhat.com/pub/newlib/newlib-1.19.0.tar.gz
51 13 ahuemer
</pre>
52 1 steve-m
53 12 ahuemer
54 13 ahuemer
h3. Building the toolchain
55
56
57
<pre>
58 1 steve-m
$ cd ..
59
$ ./gnu-arm-build.3.sh 
60
I will build an arm-none-eabi cross-compiler:
61
62
  Prefix: <YOURPATH>/install
63
  Sources: <YOURPATH>/src
64
  Build files: <YOURPATH>/build
65
66
Press ^C now if you do NOT want to do this.
67 13 ahuemer
</pre>
68 1 steve-m
69
Hit enter and after some time hopefully end up with:
70
71 13 ahuemer
<pre>
72 1 steve-m
Build complete! Add <YOURPATH>/bin to your PATH to make arm-none-eabi-gcc and friends
73
accessible directly.
74 13 ahuemer
</pre>
75 12 ahuemer
76 1 steve-m
77 13 ahuemer
h3. Making it accessible
78
79
80 1 steve-m
If you're using bash, you can add the following in your ~/.bashrc file:
81
82 13 ahuemer
<pre>
83 1 steve-m
export PATH=$PATH:<YOURPATH>/install/bin
84 13 ahuemer
</pre>
85 1 steve-m
86 14 laforge
That's it. You can build [[OsmocomBB]] now (see [[Software Getting Started]]).
87 1 steve-m
88 13 ahuemer
*Credits:*
89 1 steve-m
90 13 ahuemer
This script is a slightly updated/modified version of the script found "here":http://hobbycode.googlecode.com/svn/trunk/gnu-arm-installer/. 
91
92 1 steve-m
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.
Add picture from clipboard (Maximum size: 48.8 MB)