Set Up the Cross Compiler

From IGEP - ISEE Wiki

Revision as of 11:49, 10 May 2018 by Carlos Alonso (talk | contribs)

Jump to: navigation, search
Information.jpg The following steps has been tested using Ubuntu 16.04 and the 4.9 version of the arm-linux-gnueabihf compiler

In order to compile the Linux Kernel it

is necessary to prepare a suitable work environment by checking the compiler and its version are the corresponding.

If we want to install a particular compiler, for example the 4.9 we can use the following commands to install it:

<span class="mw-headline">sudo apt-get install g++-4.9-arm-linux-gnueabihf<br data-attributes="%20/">sudo apt-get install cpp-4.9-arm-linux-gnueabihf<br data-attributes="%20/">sudo apt-get install gcc-4.9-arm-linux-gnueabihf<br data-attributes="%20/">sudo apt-get install gcc-4.9-arm-linux-gnueabihf-base<code></code></span>

We can change between compilers using the following commands:

<span class="mw-headline">sudo update-alternatives --set arm-linux-gnueabihf-g++ "/usr/bin/arm-linux-gnueabihf-g++-4.9"<br data-attributes="%20/">sudo update-alternatives --set arm-linux-gnueabihf-cpp "/usr/bin/arm-linux-gnueabihf-cpp-4.9"<br data-attributes="%20/">sudo update-alternatives --set arm-linux-gnueabihf-gcc-ar "/usr/bin/arm-linux-gnueabihf-gcc-ar-4.9"<br data-attributes="%20/">sudo update-alternatives --set arm-linux-gnueabihf-gcc-nm "/usr/bin/arm-linux-gnueabihf-gcc-nm-4.9"<br data-attributes="%20/">sudo update-alternatives --set arm-linux-gnueabihf-gcc-ranlib "/usr/bin/arm-linux-gnueabihf-gcc-ranlib-4.9"<br data-attributes="%20/">sudo update-alternatives --set arm-linux-gnueabihf-gcov "/usr/bin/arm-linux-gnueabihf-gcov-4.9"</span>