All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 0/1] Fix redundant usage of -mcpu and -march/-mtune
Date: Tue, 13 May 2014 22:22:47 +0200	[thread overview]
Message-ID: <20140513222247.28e07ea2@free-electrons.com> (raw)
In-Reply-To: <CABbD_XBAUfowR-_TbvypUAH+R3UCWZ0RQeKA__AGJ1dPqWQ-BA@mail.gmail.com>

Dear K?roly Kasza,

On Tue, 13 May 2014 16:33:18 +0200, K?roly Kasza wrote:

> The BR2_cortex_a7=y breaks it, it will generate a warning while compiling
> busybox (every invocation of gcc):
> warning: switch -mcpu=cortex-a7 conflicts with -march=armv7-a switch
> [enabled by default]
> 
> Then an error with mmc-utils like this:
> mmc.c:1:0: error: switch -mcpu=cortex-a7 conflicts with -march=armv7-a
> switch [-Werror]

Indeed, with Cortex-A7, I can reproduce this. This is because
Cortex-A7, A-12 and A-15 support more features than the other armv7-a
cores (A5, A8, A9), so gcc has a separate -march argument: armv7ve.

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.

> > The potential problem I see is that the code you're changing is used
> > for *all* architectures, but the change you're making has only been
> > made with ARM specificities in mind. Does ignoring -march and -mtune
> > when -mcpu is defined also works for all other architectures?
> >
> This is a tough question, because based on the GCC online manual, not all
> architectures accept all three parameters.
> It looks like -mcpu is always the most definite, but is is deprecated on
> i386 and x86_64 for example.
> 
> Maybe it would be wise to define and use these 3 parameters only based on
> the target architecture.

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.

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

  reply	other threads:[~2014-05-13 20:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-13 13:58 [Buildroot] [PATCH 0/1] Fix redundant usage of -mcpu and -march/-mtune Karoly Kasza
2014-05-13 13:58 ` [Buildroot] [PATCH 1/1] " Karoly Kasza
2014-11-01 21:22   ` Thomas Petazzoni
2014-11-01 21:24     ` Károly Kasza
2014-05-13 14:04 ` [Buildroot] [PATCH 0/1] " Thomas Petazzoni
2014-05-13 14:33   ` Károly Kasza
2014-05-13 20:22     ` Thomas Petazzoni [this message]
2014-05-14  7:55       ` Károly Kasza
2014-05-14  7:59         ` Thomas Petazzoni
2014-05-14 12:33           ` Károly Kasza
2014-05-27 15:40           ` Károly Kasza

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140513222247.28e07ea2@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.