3
votes

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

2
> I get the right path of the cross compile - write this path here.someuser
Do you have make command installed?Rahul R Dhobi
can you write the result of readelf -a /path/to/arm-linux-gnueabi-gcc | grep "Requesting" here?. you might have to move the whole path to right position if the programi interpreter does not exist in that path.ymonad
I do have make installed (since I've used it before). I've tried appending the cross compiler path to the existing path: export PATH=$PATH:/home/dico/gcc-4.7-arm-linux-gnueabi_4.7.2-1/usr/bin, but when I try to compile, I still get arm-linux-gnueabi-gcc: Command not found.Adam
@ymonad I get Error: :/home/dico/gcc-4.7-arm-linux-gnueabi_4.7.2-1/usr/bin is not an ordinary file.Adam

2 Answers

2
votes

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
1
votes

For each of the binaries in your toolchain, you should create symbolic links that obey the naming convention required by your Makefile. The links should point to the respective binary that uses the non-conformant naming scheme.

cd /home/dico/gcc-4.7-arm-linux-gnueabi_4.7.2-1/usr/bin
ln -s arm-linux-gnueabi-gcc-4.7 arm-linux-gnueabi-gcc