3.1.2. Using a Cross-Toolchain Tarball

If you want to simply install a cross-toolchain by hand, you can do so by running the toolchain installer. The installer includes the pre-built cross-toolchain, the runqemu script, and support files. If you use this method to install the cross-toolchain, you might still need to install the target sysroot by installing and extracting it separately. For information on how to install the sysroot, see the "Extracting the Root Filesystem" section.

Follow these steps:

  1. Get your toolchain installer using one of the following methods:

    • Go to http://downloads.yoctoproject.org/releases/yocto/yocto-1.7.2/toolchain/ and find the folder that matches your host development system (i.e. i686 for 32-bit machines or x86_64 for 64-bit machines).

      Go into that folder and download the toolchain installer whose name includes the appropriate target architecture. The toolchains provided by the Yocto Project are based off of the core-image-sato image and contain libraries appropriate for developing against that image. For example, if your host development system is a 64-bit x86 system and you are going to use your cross-toolchain for a 32-bit x86 target, go into the x86_64 folder and download the following installer:

           poky-glibc-x86_64-core-image-sato-i586-toolchain-.sh
                                  
    • Build your own toolchain installer. For cases where you cannot use an installer from the download area, you can build your own as described in the "Optionally Building a Toolchain Installer" section.

  2. Once you have the installer, run it to install the toolchain:

    Note

    You must change the permissions on the toolchain installer script so that it is executable.

    The following command shows how to run the installer given a toolchain tarball for a 64-bit x86 development host system and a 32-bit x86 target architecture. The example assumes the toolchain installer is located in ~/Downloads/.

         $ ~/Downloads/poky-glibc-x86_64-core-image-sato-i586-toolchain-.sh
                        

    The first thing the installer prompts you for is the directory into which you want to install the toolchain. The default directory used is /opt/poky/. If you do not have write permissions for the directory into which you are installing the toolchain, the toolchain installer notifies you and exits. Be sure you have write permissions in the directory and run the installer again.

    When the script finishes, the cross-toolchain is installed. You will notice environment setup files for the cross-toolchain in the installation directory.