2.2 Setup GCC Toolchain
Set environment variables:
$ cd <WORKDIR>/Toolchain
$ tar xvf gcc-linaro
-5.3-2016.02
-x86_64_arm-linux-gnueabihf.tar.xz
$
export
PATH=$PATH:<WORKDIR>/Toolchain/gcc-linaro
-5.3-2016.02
-x86_64_arm-linux-gnueab
ihf/bin
$
export
ARCH=arm
$
export
CROSS_COMPILE=arm-linux-gnueabihf-
After executing the "export" command,type "arm" then press TAB to check if it’s
correctly set. This setting is valid only for the this terminal, for a permanent
modification, please modify user profiles.
eg:Set user environment variables
vi ~/.profile
At the end to add:
export
ARCH=arm
export
CROSS_COMPILE=arm-linux-gnueabihf-
export
PATH=$PATH:<WORKDIR>/Toolchain/
gcc-linaro
-5.3-2016.02
-x86_64_arm-linux-gnueabihf/bin
source ~/.profile or Reset Ubuntu
Test
:
$echo $ARCH
arm
$echo $CROSS_COMPILE
arm-linux-gnueabihf-
Cross compiler verification
:
arm-linux-gnueabihf-gcc -v
12