ARM GCC Toolchain in Ubuntu 16.04

06.22.2016
As pointed out by commenter Thaj below, this information is now obselete. One can install the default arm-none-eabi-gcc package provided in Ubuntu 14.04 and up without adding any special PPAs.

When I initially began using Contiki, the recommended GCC version for compiling ARM binaries was 4.9.3.

It is important not to use the arm-none-eabi-gcc package from the Ubuntu repos, because it cannot compile Contiki properly.

It is possible to install a working v4.9.3 of the ARM GCC using a PPA owned by Terry Guo. Unfortunately, that PPA does not have any binaries for Xenial. Fortunately, there is a different PPA with a newer version, v5.3.1, and which I have found does work in Ubuntu 16.04!

It should be noted that this newer version may be liable to have other bugs that have yet to be reported. YMMV. But – if we must, we must.

First, make sure to uninstall whatever version you may or may not already have:

sudo apt-get remove gcc-arm-none-eabi binutils

Ubuntu ≥ 16.04

The PPA we want in this case is from the GCC ARM Embedded Maintainer’s team.

sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
sudo apt-get update
sudo apt-get install gcc-arm-embedded

Ubuntu < 16.04

For Ubuntu machines older than 16.04, the answer is to use the terry.guo/gcc-arm-embedded PPA.

Add Terry Guo’s PPA and install the toolchain.

sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded
sudo apt-get update
sudo apt-get install arm-gcc-none-eabi