ARCH=arm or CROSS_COMPILE=arm-linux- or both ?

15 views
Skip to first unread message

Ramagudi Naziir

unread,
May 2, 2007, 2:01:21 AM5/2/07
to kernelnewbies
Hello,,

I read in Karim Yaghmour's book that to cross compile the kernel and
other packages I need these two arguments.

But when I see other kernel cross compiling guide they only say to
use the ARCH=arm.

so.. do I need both of them ? or just the ARCH one ?

A lot of Thanks
naziir

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to eca...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ

Rajat Jain

unread,
May 2, 2007, 3:04:42 AM5/2/07
to Ramagudi Naziir, kernelnewbies
> I read in Karim Yaghmour's book that to cross compile the kernel and
> other packages I need these two arguments.
>
> But when I see other kernel cross compiling guide they only say to
> use the ARCH=arm.
>
> so.. do I need both of them ? or just the ARCH one ?

ARCH is certainly required, because it will select the approprieate
directory to compile from arch/* and headers to include from
include/asm-*.

CROSS_COMPILE may not be needed if you have the default cross compiler
for the architecture (arm-linux-gcc?) in your PATH. However, if that
is not the case, or you have multiple versions cross compilers
installed, it is recommened that you give CROSS_COMPILE=

Thanks,

Rajat

Shinose

unread,
May 2, 2007, 9:15:00 AM5/2/07
to Ramagudi Naziir, kernelnewbies
On 5/2/07, Ramagudi Naziir <naz...@gmail.com> wrote:
Hello,,

I read in Karim Yaghmour's book that to cross compile the kernel and
other packages I need these two arguments.

But when I see other kernel cross compiling guide they only say to
use the ARCH=arm.

so.. do I need both of them ? or just the ARCH one ?

You need to provide the ARCH and CROSS_COMPILE variables in order to compile for your desired cross platform. If you miss either of the argument then the Makefile defaults to what ever given inside it as defaults.

For .e.g if your processor is ARM and you have the tool chain starting with arm-linux- like arm-linux-gcc, arm-linux-ld etc then you need to provide like

$make zImage ARCH=arm CROSS_COMPILE=arm-linux-

for arm-elf-gcc you need to give

$make zImage ARCH=arm CROSS_COMPILE=arm-elf-
 

Robert P. J. Day

unread,
May 2, 2007, 9:32:11 AM5/2/07
to Shinose, Ramagudi Naziir, kernelnewbies
On Wed, 2 May 2007, Shinose wrote:

> On 5/2/07, Ramagudi Naziir <naz...@gmail.com> wrote:
> >
> > Hello,,
> >
> > I read in Karim Yaghmour's book that to cross compile the kernel and
> > other packages I need these two arguments.
> >
> > But when I see other kernel cross compiling guide they only say to
> > use the ARCH=arm.
> >
> > so.. do I need both of them ? or just the ARCH one ?
>
>
> You need to provide the ARCH and CROSS_COMPILE variables in order to compile
> for your desired cross platform. If you miss either of the argument then the
> Makefile defaults to what ever given inside it as defaults.
>
> For .e.g if your processor is ARM and you have the tool chain starting with
> arm-linux- like arm-linux-gcc, arm-linux-ld etc then you need to provide
> like
>
> $make zImage ARCH=arm CROSS_COMPILE=arm-linux-
>
> for arm-elf-gcc you need to give
>
> $make zImage ARCH=arm CROSS_COMPILE=arm-elf-

don't forget that, if you use just that prefix, your entire toolchain
better be found somewhere in your search PATH. if it's not, then you
can always use:

$ make ARCH=arm CROSS_COMPILE=/home/fred/tools/...blah.../arm-elf- zImage

or whatever's appropriate. it's just easier to have it in your search
path, though.

rday
--
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://fsdev.net/wiki/index.php?title=Main_Page
========================================================================

Reply all
Reply to author
Forward
0 new messages