Project

General

Profile

GnuArmToolchain » History » Version 11

tsaitgaist, 02/19/2016 10:48 PM
texinfo bug

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