This is a more elaborate method. Here, we clone the toolchain from the Raspberry Pi's GitHub repo:
- Download the toolchain. Let's place it under the folder called rpi_tools within our Raspberry Pi staging directory:
cd ${RPI_STG}/rpi_tools
git clone https://github.com/raspberrypi/tools
- Update the PATH environment variable so that it contains the toolchain binaries:
export PATH=${PATH}:${RPI_STG}/rpi_tools/tools/arm-bcm2708/arm-linux-gnueabihf/bin/
Setting the PATH environment variable (as shown in the preceding code) is required. However, it's only valid for the current shell session. Make it permanent by putting the preceding line into a startup script (typically your ${HOME}/.bashrc file or equivalent).
As mentioned earlier, alternate toolchains can be used as well. For example, several toolchains for ARM development (for A-profile processors) are available on the ARM developer site at https...