I am cross compiling the Raspbian kernel since it will take about 12 hours for the Pi to do (Raspberry Pi 1).

I have the build tools for ARM and the kernel in two separate folders in /home/gray/Desktop/tmp/

I am following this guide: http://elinux.org/Raspberry_Pi_Kernel_Compilation

My issue is that when I go to compile, it can't find arm-linux-gnueabihf-gcc-4.8.3 which is clearly in the folder I linked when I did export CCPREFIX. Here is what I did:

gray@Rava-Xubuntu:~/Desktop/tmp/linux$ export CCPREFIX=/home/gray/Desktop/tmp/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-

And it returns when I try to build:

gray@Rava-Xubuntu:~/Desktop/tmp/linux$ make ARCH=arm CROSS_COMPILE=${CCPREFIX}
/home/gray/Desktop/tmp/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc: 1: /home/gray/Desktop/tmp/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc: arm-linux-gnueabihf-gcc-4.8.3: not found
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
make[1]: 'include/generated/mach-types.h' is up to date.
  CC      kernel/bounds.s
/home/gray/Desktop/tmp/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc: 1: /home/gray/Desktop/tmp/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc: arm-linux-gnueabihf-gcc-4.8.3: not found
Kbuild:43: recipe for target 'kernel/bounds.s' failed
make[1]: *** [kernel/bounds.s] Error 127
Makefile:990: recipe for target 'prepare0' failed
make: *** [prepare0] Error 2

Even though the file is clearly in there:

Even though the file is clearly in there


  • Try on unix.stackexchange.com/questions – Milliways Dec 2 '15 at 0:04
  • As a guess, your cross GCC installation might be broken, or possibly for the wrong ABI (32 vs 64 bit) vs your development machine. – Chris Stratton Dec 2 '15 at 1:51
  • Does this return the version? /home/gray/Desktop/tmp/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc -v It could also mean *-gcc may be incorrectly soft linked or may not be having execute permissions (+x) What does ls -l /home/gray/Desktop/tmp/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/ | grep "^l" return? (an l for link) What does ls -l /home/gray/Desktop/tmp/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc-4.8.3 return? – user36965 Dec 2 '15 at 4:19
  • This leads to the same issue. For some reason that gcc executable cannot find the other executable in the same folder. You can see it in the screenshot above. gray@Rava-Xubuntu:~/Desktop/tmp/linux$ /home/gray/Desktop/tmp/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc -v /home/gray/Desktop/tmp/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc: line 1: arm-linux-gnueabihf-gcc-4.8.3: command not found – Gray Dec 2 '15 at 4:38
  • The first one returns nothing. The second one finds the file: gray@Rava-Xubuntu:~/Desktop/tmp/linux$ ls -l /home/gray/Desktop/tmp/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/ | grep "^l" gray@Rava-Xubuntu:~/Desktop/tmp/linux$ ls -l /home/gray/Desktop/tmp/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc-4.8.3 -rwxr-xr-x 1 gray gray 571736 Dec 1 15:58 /home/gray/Desktop/tmp/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc-4.8.3 – Gray Dec 2 '15 at 5:51

So I figured it out.

I just grabbed the crossbuild version of gcc (I think that is what it is)

sudo apt-get install crossbuild-essential-armhf

And then my new path is:

export CCPREFIX=/usr/bin/arm-linux-gnueabihf-

And the build works perfectly!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.