Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make: command not found when specifying cross compiler path

I am trying to compile a kernel on my FOX G20 V board. In order to do so, I have to specify the cross compiler in one of the steps arm-linux-gnueabi. The command is

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- at91-ariag25.dtb

So in order for the compiler to know where the executable of the cross compiler is, I specify it in the path by doing

export PATH=$PATH:/home/path_goes_here/bin

When I do echo $PATH, I get the right path of the cross compiler. However, now when I do the make of my project, I receive:

make: command not found

But when I don't specify the path of the compiler, the make works but when it reaches the point of the cross compiler, it gives me:

make: arm-linux-gnueabi-gcc: Command not found

I think that my make is not in my system path when I change it to the cross compiler. Therefore, how can I add both the make and the cross compiler to the system path?

EDIT

My cross compiler is actually arm-linux-gnueabi-gcc-4.7, and not arm-linux-gnueabi-gcc. Yet when I specify the cross compiler in the make by doing CROSS_COMPILE=arm-linux-gnueabi-, I get:

make: arm-linux-gnueabi-gcc: Command not found

Because arm-linux-gnueabi-gcc isn't the one it should be looking for. Yet when I specify CROSS_COMPILE=arm-linux-gnueabi-gcc-4.7, it appends gcc at the end of that and gives me:

make: arm-linux-gnueabi-gcc-4.7gcc: Command not found

EDIT 2

I simply renamed the cross compiler and that seemed to work. But now, I get the error:

arm-linux-gnueabi-gcc: error trying to exec 'cc1': execvp: No such file or directory

like image 316
Adam Avatar asked Mar 15 '26 21:03

Adam


1 Answers

Setting CROSS_COMPILE is only a shorthand for setting all of CC=$(CROSS_COMPILE)cc AS=$(CROSS_COMPILE)as LD=$(CROSS_COMPILE)ld etc etc (just take a look at the top level Makefile with less(1))

So you should be able to do this

$ export ARCH=arm
$ xc=arm-linux-gnueabi-
$ export CC=$(xc)gcc-4.7
$ export AS=$(xc)as-4.7
$ export LD=$(xc)ld-4.7
etc etc
$ make at91-ariag25.dtb
like image 120
nodakai Avatar answered Mar 17 '26 11:03

nodakai



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!