Skip to content
Mariano Alvira edited this page Dec 2, 2013 · 4 revisions

Installing the preferred ARM toolchain for the mc1322x

Currently the preferred toolchain for the mc1322x project is the Sourcery G++ Lite 2008q3-66 for ARM EABI. It's based on the following:

  • GNU Binary Utilities (2.18.50-sg++)
  • GNU C & C++ Compilers (4.3.2-sg++)
  • GNU Debugger (6.8.50-sg++)
  • Newlib C Library (1.16.0-sg++)

with patches from CodeSourcery. This is very similar to the previous mc1322x-oe toolchain. OE has moved on to newer chains (and eglibc). It is also not straightforward to make "bare-metal" chains (arm-none-) with OE. For these reasons, the OE toolchain is getting retired (good riddance!)

Installing the chain

On a 64-bit machine

You will need the 32-bit compatibility libraries to run this on a 64-bit machine:

apt-get install ia32-libs

Download and install

You can either download and install the executable .bin or just the binary package. Either way you will have to add the executables to your PATH

Linux Installer

Download the .bin installer:

$ wget https://sourcery.mentor.com/public/gnu_toolchain/arm-none-eabi/arm-2008q3-66-arm-none-eabi.bin

then:

$ sh arm-2008q3-66-arm-none-eabi.bin

and modify your path:

PATH=$PATH:$HOME/CodeSourcery/Sourcery_G++_Lite/bin

Binary package

Download the archive:

wget https://sourcery.mentor.com/public/gnu_toolchain/arm-none-eabi/arm-2008q3-66-arm-none-eabi-i686-pc-linux-gnu.tar.bz2

extract the archive:

tar xjvf arm-2008q3-66-arm-none-eabi-i686-pc-linux-gnu.tar.bz2

and setup your PATH:

$ export PATH=$PATH:$HOME/arm-2008q3/bin

Windows

Download and run:

http://www.codesourcery.com/sgpp/lite/arm/portal/package3689/public/arm-none-eabi/arm-2008q3-66-arm-none-eabi.exe

GCC 4.5

Moving to GCC 4.5 will take some a little work. Both the 4.5 CS chain and the Linaro chain (which will be included in Ubuntu starting with maverick) are options. They are both built with AAPCS support. This does not work with the ROM calls as is (used by the project for the NVM and LQI). To get these newer chains to work, the ROM calls will have to be wrapped with the necessary assembly. Work on this is done in the gcc-linaro branch of libmc1322x.

There is also a GCC bug regarding -Os flag. This has been fixed in upstream 4.5. The fix should be present in Linaro 4.5 and will eventually be backported to 4.4. For now, the gcc-linaro simply doesn't use -Os