Subject: Re: Predefined Compiler Flag for CROSS_COMPILE in ELDK

From: Detlev Zundel <[email-masked]>
Date: Thu, 08 May 2008 18:38:11 +0200

Hi Rodolfo,

> -mcpu is deprecated:
>
> HOSTCC  scripts/basic/fixdep
> `-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
> scripts/basic/fixdep.c:1: error: bad value (405) for -mtune= switch
> make[1]: ** [scripts/basic/fixdep] Erro 1
> make: ** [scripts_basic] Erro 2

Uhu - HOSTCC is the native compiler, which very likely does not know
anything about 405 cpus...

> then I put -march=405 and give this errors:
>
> scripts/basic/fixdep.c:1: error: bad value (405) for -march= switch
> scripts/basic/fixdep.c:1: error: bad value (405) for -mtune= switch
> make[1]: ** [scripts/basic/fixdep] Erro 1
> make: ** [scripts_basic] Erro 2

Still, same problem - you want to use the flag for the cross compiler.

> See a piece of my Makefile:
>
> HOSTCC       = gcc
> HOSTCXX      = g++
> HOSTCFLAGS   = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
> -march=405
> HOSTCXXFLAGS = -O2

Again, this is the host compiler.

> How can I do this?

If we are only talking about compiling a recent linux kernel, then the
easiest way is to simply override CFLAGS_KERNEL from the commandline,
i.e.:

make CFLAGS_KERNEL=-mcpu=405 uImage

If you want to check that this works, do a

make CFLAGS_KERNEL=-mcpu=405 V=1 uImage

and check the generated command lines.

Cheers
  Detlev

-- 
Alisa Sherer (AMD) suggested that consumer demand will not follow
faster clock speeds. Marketing might help with this problem, she
added.                                            -- 2004/02/20
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: [email-masked]