Project

General

Profile

Actions

GnuArmToolchain » History » Revision 18

« Previous | Revision 18/19 (diff) | Next »
unrznbl, 02/26/2021 04:31 AM
added a note about dependency packages might not be right versions, fiddle with it on your distribution


GNU ARM toolchain

This page will describe the procedure for compiling a GNU ARM toolchain.
We will build a toolchain consisting of:

  • GCC 4.8.2
  • Binutils 2.21.1
  • Newlib 1.19

Getting the buildscript

First of all, create a directory you want to use for building the toolchain, and download the buildscript [raw-gnu-arm-build.3.sh] there.
You will need to make it executable:

$ chmod +x gnu-arm-build.3.sh

Dependencies

In order to build the toolchain, you will need to install the following packages (assuming you're using a Debian-based distribution):

$ sudo apt-get install build-essential libgmp3-dev libmpfr-dev libx11-6 libx11-dev texinfo flex bison libncurses5 \
  libncurses5-dbg libncurses5-dev libncursesw5 libncursesw5-dbg libncursesw5-dev zlibc zlib1g-dev libmpfr4 libmpc-dev

Note: you maybe have to adjust some libncurses and libmfr version numbers in the above for newer distributions (as of 2021). Use apt-cache search to figure it out.

Preparation

Open a shell in the directory of gnu-arm-build.sh and create the following directories:

$ mkdir build install src

Download the needed sources to src/:

$ cd src/
$ wget http://ftp.gnu.org/gnu/gcc/gcc-4.8.2/gcc-4.8.2.tar.bz2
$ wget http://ftp.gnu.org/gnu/binutils/binutils-2.21.1a.tar.bz2
$ wget ftp://sources.redhat.com/pub/newlib/newlib-1.19.0.tar.gz

On Ubuntu 18.04 and Debian 10, tweak the build script such that it applies gcc-4.8.2-ubuntu-18-04.diff after unpacking gcc sources.

Building the toolchain

$ cd ..
$ ./gnu-arm-build.3.sh 
I will build an arm-none-eabi cross-compiler:

  Prefix: <YOURPATH>/install
  Sources: <YOURPATH>/src
  Build files: <YOURPATH>/build

Press ^C now if you do NOT want to do this.

Hit enter and after some time hopefully end up with:

Build complete! Add <YOURPATH>/bin to your PATH to make arm-none-eabi-gcc and friends
accessible directly.

Making it accessible

If you're using bash, you can add the following in your ~/.bashrc file:

export PATH=$PATH:<YOURPATH>/install/bin

That's it. You can build OsmocomBB now (see Software Getting Started).

Credits:

This script is a slightly updated/modified version of the script found here.

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.

Files (4)
gnu-arm-build.sh gnu-arm-build.sh 3.22 KB The GNU ARM toolchain buildscript steve-m, 01/02/2011 04:47 PM
gnu-arm-build.2.sh gnu-arm-build.2.sh 3.23 KB , 09/07/2011 11:32 AM
gnu-arm-build.3.sh gnu-arm-build.3.sh 3.31 KB ahuemer, 06/17/2015 07:11 PM
gcc-4.8.2-ubuntu-18-04.diff gcc-4.8.2-ubuntu-18-04.diff 1.04 KB stsp, 08/23/2018 11:51 AM

Updated by unrznbl about 3 years ago · 18 revisions

Add picture from clipboard (Maximum size: 48.8 MB)