view · edit · print · history

Note that the Unslung packages build system now builds its own toolchain, so the following information is no longer required, and can be considered as purely historical information.

For NSLU2 Linux development, we are currently using crosstool-0.28-rc35.

Note that crosstool-0.28-rc35 uses kernel 2.4.26 headers, whereas crosstool-0.28-rc37 uses kernel 2.6.8 headers. Neither of these match the kernel that unslung uses, which is 2.4.22. This can cause compilation problems for some Unslung packages, and may also cause run-time problems.

If you have built crosstool according to the instructions previously published here, you may wish to rebuild using the updated instructions - these will explicitly request kernel headers that match what is used by the unslung firmware.

The instructions for building this toolchain can be found here:

Before following the instructions in the above link, make sure you unset LD_LIBRARY_PATH, C_INCLUDE_PATH and CPLUS_INCLUDE_PATH in your environment. Otherwise, you will be unhappy when the build dies partway through. The error message is quite understandable, but once you've unset the variable as directed, the build starts over from scratch.

Also, before you start, make sure you are using a recent stable version of GCC on your build machine. GCC 2.95 is not a recent version :-)

  1. Grab a Linux box (I used Debian 3.1 "testing" on an Intel architecture).

    Make sure you have bzip2 installed.

    Other architectures and versions of Linux may well work. If you get errors, then start again on an i386 Debian 3.1 box. In particular the version of GCC that I used was: "gcc (GCC) 3.3.4 (Debian 1:3.3.4-3)". (Mac OS-X users see the HowTo.CompileCrossToolOnOSX for instructions on setting up some prerequisites then proceed as below.)
  2. Download crosstool-0.28-rc35 from:

  3. Untar that - it will create a crosstool-0.28-rc35 directory.
  4. Copy the demo-nslu2.sh file from the end of this page and put it in that directory.

    This file assumes that you have write access to /opt/crosstool (this is where your resulting toolchain will end up) and $HOME/downloads (this is where all the downloads will be stored). If you don't, then change the paths to suit. Do *not* change any of the tool version numbers in this file. Don't even be tempted ...
  5. Change directory into the crosstool-0.28-rc35 directory.
  6. Type sh demo-nslu2.sh and wait for a long time (yes it could be hours).
  7. Add the /opt/crosstool/armv5b-softfloat-linux/gcc-3.3.4-glibc-2.2.5/bin directory to your PATH. Verify that you can run armv5b-softfloat-linux-gcc --version.

If you have problems (and have followed this exact procedure twice with the same result), then post your complete Linux O/S details, the URLs and md5sums of all the files you downloaded (including the demo-nslu2.sh file you detached from this message), the *exact* commands you typed (yes, every single one of them, copy and paste from your shell window or bash_history), and the error messages (again, copy and paste from your shell window). Also tell us what version of GCC you are using to compile crosstool.

Have fun!

set -ex

# Really, you should do the mkdir before running this,
# and chown /opt/crosstool to yourself so you don't need to run as root.
mkdir -p $RESULT_TOP

# Build the toolchain. Takes a couple hours and a couple gigabytes.

eval `cat armv5b-softfloat.dat gcc-3.3.4-glibc-2.2.5.dat` LINUX_DIR=linux-2.4.22 sh all.sh --notest

echo Done.

If you have confirmed that a later version of crosstool will build and run correctly, then insert the details here.

20 Oct 2004:
No problems with crosstool-0.28-rc37 using RHL 9.0 or Gentoo x86

06 Dec 2004:
No Problems with crosstool-0.28-rc35 using Gentoo 2004.3 amd64:
Linux night 2.6.9-gentoo-r6 #9 Sat Dec 4 18:09:48 EST 2004 x86_64 AMD Athlon(tm) 64 Processor 3400+ AuthenticAMD? GNU/Linux

http://kegel.com/crosstool/crosstool-0.28-rc37/buildlogs/0.28 has a compatibility matrix for crosstool.


view · edit · print · history · Last edited by rwhitby.
Based on work by rwhitby, schinckel, Lex Delani, tjyang, bobtm, peteru, Christopher Blunck, tman, seadevil, snhenson, kaste, dyoung, ka6sox, bnz, and glum.
Originally by rwhitby.
Page last modified on May 29, 2005, at 04:31 AM