[Buildroot] [PATCH 0/1] Fix redundant usage of -mcpu and -march/-mtune

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Wed May 14 07:59:32 UTC 2014


Dear Károly Kasza,

On Wed, 14 May 2014 09:55:09 +0200, Károly Kasza wrote:

> > So normally, we should set BR2_GCC_TARGET_ARCH to armv7ve for those
> > Cortex-A variants. I'm currently experimenting with this, but I'm
> > having a few issues. Also, it's likely that armv7ve is quite recent,
> > and may not be present in older gcc versions.
> >
> >
> That's the case with the Linaro 2014.02 toolchain - in GCC 4.8.2 the
> armv7ve does not exist
> (http://gcc.gnu.org/onlinedocs/gcc-4.8.2/gcc/ARM-Options.html#ARM-Options).

Yeah, in gcc 4.8.2 vanilla. But Linaro toolchains don't use a vanilla
gcc, they have lots of ARM related patches. And if the Linaro
toolchains complains that -march=armv7-a is incompatible with
-mcpu=cortex-a7, then quite certainly it means that cortex-a7 is part
of a different -march family, according to this toolchain.

> > This is already the case. They are only passed if
> > BR2_GCC_TARGET_{ARCH,CPU,TUNE} are defined. Some architectures (such as
> > ARM) defines all three, but other architectures (such as x86) do not.
> >
> Now I see. In this case, maybe the simplest would be to just leave
> BR2_GCC_TARGET_ARCH
> undefined in arch/Config.in.arm if the user selected a proper CPU (and not
> just some generic one).

Not sure what you mean by "not just some generic one". In the
menuconfig, what we ask the user is to define the specific ARM core
being used. From that we can derive the -march and -mcpu values. But
indeed, the -march value is quite useless.

However, I believe there are place in Buildroot where we do use the
BR2_GCC_TARGET_ARCH value for other things than just the compiler
flags. We would have to audit those before removing BR2_GCC_TARGET_ARCH
from Config.in.arm.

> Also, based on the documentation it should be completely unnecessary to
> define -march if we have the accurate CPU with -mcpu (on ARM at least).

Correct.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


More information about the buildroot mailing list