My Wiki!

Build Linaro toolchain with crosstools-ng

Preparation

  • Debian 64 bit


sudo apt-get build-dep binutils gcc
sudo apt-get gperf gawk libtool libncurses5-dev subversion

Download

wget http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-VERSION.tar.bz2
tar xjf crosstool-ng-VERSION.tar.bz2
cd crosstool-ng-VERSION
./configure --prefix=/some/place
make
make install
export PATH="${PATH}:/some/place/bin"

Build Crosstool-ng

Create a place to work in, then list the existing samples (pre-configured toolchains that are known to build and work) to see if one can fit your actual needs. Sample names are 4-part tuples, such as arm-unknown-linux-gnueabi. In the following, we'll use that as a sample name; adapt to your needs:

mkdir /a/directory/to/build/your/toolchain
cd /a/directory/to/build/your/toolchain
ct-ng help
ct-ng list-samples
ct-ng show-arm-unknown-linux-gnueabi

Once you know what sample to use, configure ct-ng to use it:

ct-ng arm-unknown-linux-gnueabi

Samples are configured to install in “${HOME}/x-tools/arm-unknown-linux-gnueabi” by default. This should be OK for a first time user, so you can now build your toolchain:

ct-ng build

Finally, you can set access to your toolchain, and call your new cross-compiler with :

export PATH="${PATH}:${HOME}/x-tools/arm-unknown-linux-gnueabi/bin"
arm-unknown-linux-gnueabi-gcc

Of course, replace arm-unknown-linux-gnueabi with the actual sample name you choose! ;-)

If no sample really fits your needs:

choose the one closest to what you want (see above), and start building it (see above, too) this ensures sure it is working for your machine, before trying to do more advanced tests fine-tune the configuration, and re-run the build, with:

ct-ng menuconfig
ct-ng build

Then, if all goes well, your toolchain will be available and you can set access to it as shown above.

See contacts, below for how to ask for further help.

Note 1: If you elect to build a uClibc-based toolchain, you will have to prepare a config file for uClibc.

TODO Step by Step latest crosstools-ng

git clone git://crosstool-ng.org/crosstool-ng
cd crosstool-ng
./bootstrap
./configure --enable-local
make
./ct-ng help
./ct-ng menuconfig
./ct-ng build

Build Linaro toolchain

  mkdir toolchain-{build,target}
  cd toolchain-build
  ct-ng menuconfig
  

Build configuration

  • Target –> toolchain-target
  • C Compiler
    • abiehf
    • 32-bit

Navigation