3.4. Optionally Building a Toolchain Installer

As an alternative to locating and downloading a toolchain installer, you can build the toolchain installer if you have a Build Directory.

Note

Although not the preferred method, it is also possible to use bitbake meta-toolchain to build the toolchain installer. If you do use this method, you must separately install and extract the target sysroot. For information on how to install the sysroot, see the "Extracting the Root Filesystem" section.

To build the toolchain installer and populate the SDK image, use the following command:

     $ bitbake image -c populate_sdk
        

The command results in a toolchain installer that contains the sysroot that matches your target root filesystem.

Another powerful feature is that the toolchain is completely self-contained. The binaries are linked against their own copy of libc, which results in no dependencies on the target system. To achieve this, the pointer to the dynamic loader is configured at install time since that path cannot be dynamically altered. This is the reason for a wrapper around the populate_sdk archive.

Another feature is that only one set of cross-canadian toolchain binaries are produced per architecture. This feature takes advantage of the fact that the target hardware can be passed to gcc as a set of compiler options. Those options are set up by the environment script and contained in variables such as CC and LD. This reduces the space needed for the tools. Understand, however, that a sysroot is still needed for every target since those binaries are target-specific.

Remember, before using any BitBake command, you must source the build environment setup script (i.e. oe-init-build-env or oe-init-build-env-memres) located in the Source Directory and you must make sure your conf/local.conf variables are correct. In particular, you need to be sure the MACHINE variable matches the architecture for which you are building and that the SDKMACHINE variable is correctly set if you are building a toolchain designed to run on an architecture that differs from your current development host machine (i.e. the build machine).

When the bitbake command completes, the toolchain installer will be in tmp/deploy/sdk in the Build Directory.

Note

By default, this toolchain does not build static binaries. If you want to use the toolchain to build these types of libraries, you need to be sure your image has the appropriate static development libraries. Use the IMAGE_INSTALL variable inside your local.conf file to install the appropriate library packages. Following is an example using glibc static development libraries:
     IMAGE_INSTALL_append = " glibc-staticdev"