There is a build script for the toolchain that builds and installs the toolchain from source. This is updated as the toolchain changes, so it usually works. This can be used in combination with the cvs scripts provided to ensure that you have the most up-to-date toolchain. The locations for the build directory and the source directory must be included when you run the script. Running the script will build multiple toolchains which are documented in the Blackfin toolchain targets page.

To build from source, you need the source of the kernel and toolchain. The kernel source is required because we need the userspace kernel headers. It is important that the dates of the kernel and toolchain source be close to each other. For normal development, this means you should use a release toolchain source, with a release toolchain kernel. All released code can be found in the relevant project release pages on the Blackfin website (such as the Toolchain releases, Kernel releases, and U-Boot releases).

If you need to build a svn toolchain, it is recommended to use a svn kernel source. Although, at first glance, it seems like the toolchain, bootloader, libraries, and kernel should be separate - that is not true. A bug in the toolchain and cover up problems in the kernel, and bootloader, as toolchains are fixed, bootloaders, and kernels must also be modified. Debugger lives in both the toolchain cvs (for the host part), and the kernel cvs (for the target gdbserver). Adding new features like shared libraries require changes in both the toolchain and kernel cvs. Because of these, and other issues, building a svn toolchain, and using a non-svn kernel uClibc is not supported/tested/validated. To get the svn source, have a look in the developing with live sources section.

Building takes awhile as it will be compiling binutils/gcc/uClibc multiple times over (once per target).

-b is the directory where the toolchain is built (default is current directory)

-o is the output directory

-u builds mkimage(to create compressed images) and gen_eth_addr (to generate private MAC addresses). Without this option, the default kernel will be built without a compressed image (something that most people want).

There are also some optional flags:

-c GCC_VERSION gcc version to build (either 3.4 or 4.1). Can be given multiple times

-p Check prerequisites

-d Date Stamp all output files

-h prints out help

-t tests the bfin-elf toolchain on the simulator

-T IP_NUM tests the bfin-uclinux toolchain on the hardware. Note - IP_NUM must be a Blackfin platform, which is running rcp, and rsh.

-m MAKE Default make (leave blank to use system make)

-C FILE Use FILE as uClibc config file, rather than the default. This is necessary to change default settings of uClibc.

To get up to date options, do ./BuildToolChain -h.

The actual compiler executables will be located in the directories with their respective designation. eg. Using the above command the executables would be located in the cvsoutput-elf and cvsoutput-uclinux directories.

The output of the buildscript will look something like (this will also tell you how long it can take ~40min on a fast machine).

You should see a message during the build if everything is working properly:

*** Building Locale

The BuildToolChain will see that Locale support is turned on, and do the necessary steps in uClibc, as required in the extra/locale/README. Search in the Buildscript for UCLIBC_HAS_LOCALE for more information. The -l c tells the compiler to only build the C language (not C++), since there are some remaining issues in C++/Locale support with uClibc.