Toolchain

From Sharpfin
Jump to navigation Jump to search

Download Crosstool

Crosstool is a collection of scripts which can help you building a cross compiler toolchain without pain. Get the latest version from [1]

Build the toolchain

Reciva uses two different toolchains to build the radio software. gcc 3.3.4 is used for the kernel, and 4.1.0 is used for the userspace applications.

The following creates the 4.1.0 toolchain in /opt.

  • First check that you have flex and bison as they are required but the toolchain builder doesn't check for them.
  • unpack crosstool into /opt and rename it. (You will probably need to be root to do this):
 cd /opt 
 tar -zxvf crosstool-<version>.tgz
 mv crosstool-<version> crosstool
  • The crosstool builder won't run if you are root but normal users can't write to /opt so set the permissions on the crosstool directory.
 chown -R <normal-user> crosstool
  • Log in as a normal user and go to /opt
  • choose the right flavour and build
 export RESULT_TOP=/opt/crosstool
 eval `cat arm9tdmi.dat gcc-4.1.0-glibc-2.3.2.dat` sh all.sh --notest

This might take some time. If all goes well, you'll and up with a fresh cross complier in /opt/crosstool

Configure Your Shell

The sharpfin build scripts look for 'arm-9tdmi-linux-gnu-gcc' and other cross-compiling programs in the path. If you add the following lines to your .bashrc file, any cross-tools programs you build will automatically be added to your path:

COMPILERS=`echo /opt/crosstool/*/*/bin | sed -e 's/ /:/g'`
PATH=$PATH:$COMPILERS