How can I properly download the linaro toolchain and set it up so that I can use it with the kernel Makefile? When I test my version on the arm-linux-gnueabihf-gcc --version
function it works but when compiling a custom kernel it fails.
Context
I am working to compile a custom linux kernel for the Beaglebone Black board. The guide I am following to build the custom kernel is here.
While following the steps for the guide, I need to use arm-linux-gnueabihf-gcc
in order to cross compile the kernel for the Beaglebone hardware. So I have installed linaro's toolchain from their website. I just downloaded it and then unpacked it to the /opt/
folder.
$ cd /opt/
$ sudo mv gcc-linaro-7.1.1-2017.08-x86_64_arm-linux-gnueabi.tar.xz/ gcc-arm-linux
$ export PATH=$PATH:/opt/gcc-arm-linux/bin
I test and make sure that things worked in installing.
$ arm-linux-gnueabihf-gcc --version
And my output looks like the following image:
Once I'm finished with that I am compiling the kernel using the standard Makefile.
$ cd ~/linux
$ sudo make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bb.org_defconfig
$ sudo make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- uImage dtbs LOADADDR=0x80008000 -j4
At this point I run into errors on the command to actually compile the kernel.
Makefile:686: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
make: arm-linux-gnueabihf-gcc: Command not found
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CC scripts/mod/empty.o
/bin/sh: 1: arm-linux-gnueabihf-gcc: not found
scripts/Makefile.build:258: recipe for target 'scripts/mod/empty.o' failed
make[2]: *** [scripts/mod/empty.o] Error 127
scripts/Makefile.build:403: recipe for target 'scripts/mod' failed
make[1]: *** [scripts/mod] Error 2
make[1]: *** Waiting for unfinished jobs....
Makefile:556: recipe for target 'scripts' failed
make: *** [scripts] Error 2
make: *** Waiting for unfinished jobs....
What is most confusing is that the errors indicate that arm-linux-gnueabihf-gcc: not found
, however I can run the command arm-linux-gnueabihf-gcc --version
in the same folder and it will execute properly.
The solution to this problem could be to just install it using apt:
sudo apt-get install gcc-arm*
Which is suggested in this response, but that doesn't resolve my confusion.
Why can I test my version on the arm-linux-gnueabihf-gcc
function but it doesn't execute in the Makefile properly? How can I properly download the linaro toolchain and set it up so that I can use it with the kernel Makefile?