All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Hatle <mark.hatle@windriver.com>
To: Khem Raj <raj.khem@gmail.com>
Cc: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>,
	openembedded-devel@lists.openembedded.org
Subject: Re: [PATCH] cortex-m3: adjusted target cflags
Date: Mon, 07 Feb 2011 14:42:21 -0600	[thread overview]
Message-ID: <4D50592D.2030300@windriver.com> (raw)
In-Reply-To: <AANLkTikT+xiXg5W39LzE4dHyLjGnO1oQF3=x_k0mXAjN@mail.gmail.com>

On 2/7/11 2:19 PM, Khem Raj wrote:
> On Mon, Feb 7, 2011 at 11:39 AM, Mark Hatle <mark.hatle@windriver.com> wrote:
>> On 2/7/11 1:33 PM, Khem Raj wrote:
>>> On Mon, Feb 7, 2011 at 7:53 AM, Enrico Scholz
>>> <enrico.scholz@sigma-chemnitz.de> wrote:
>>>> Explicit '-mthumb' is required because Cortex-M3 does not support ARM
>>>> instructions and actual flags cause gcc to fail with 'error: target CPU
>>>> does not support ARM mode'.
>>>>
>>>> The '-mcpu=cortex-m3' is shorter than '-march=armv7-m -mtune=cortex-m3'
>>>> and enables workarounds like '-mfix-cortex-m3-ldrd'.
>>>
>>> Does -mcpu=cortex-m3 also cause gcc to tune for cortex-m3 ?
>>
>> -mcpu=cortex-m3 is equivalent to -march=cortex-m3 -mtune=cortex-m3
> 
> is -march=cortex-m3 valid even ? my question was if we select armv7-m
> using -march
> then gcc knows stuff like oh this arch has a hardware div instruction
> but now if we
> use -mcpu will it still do it.

You would have to look in the source and see if -mcpu=cortex-m3 is an "alias"
for anything or simply uses the default logic of cpu == march && mtune..

(FYI, last time I looked at how this worked was a year or so ago.. so if the way
GCC processes options has changed, then I'm wrong..  but it's worth looking at..
 I was scolded many times by GCC developers that -mcpu= is not the same as
specifically setting the arch and tune.)

Usually you use march & mtune when you are trying to make a set of binaries that
is capable of running on multiple cores in the same family.  I see it used the
most of IA and Power systems myself.

--Mark



  reply	other threads:[~2011-02-07 20:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-07 15:53 [PATCH] cortex-m3: adjusted target cflags Enrico Scholz
2011-02-07 15:53 ` [PATCH] gcc-4.5: added thumb2 build patch Enrico Scholz
2011-02-07 16:35   ` Koen Kooi
2011-02-07 17:25   ` [PATCH, v2] " Enrico Scholz
2011-02-07 18:30     ` Khem Raj
2011-02-07 19:33 ` [PATCH] cortex-m3: adjusted target cflags Khem Raj
2011-02-07 19:39   ` Mark Hatle
2011-02-07 20:19     ` Khem Raj
2011-02-07 20:42       ` Mark Hatle [this message]
2011-02-07 20:59   ` Enrico Scholz
2011-02-07 21:35     ` Khem Raj
2011-02-07 22:27       ` Enrico Scholz
2011-02-07 22:35         ` Khem Raj

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=4D50592D.2030300@windriver.com \
    --to=mark.hatle@windriver.com \
    --cc=enrico.scholz@sigma-chemnitz.de \
    --cc=openembedded-devel@lists.openembedded.org \
    --cc=raj.khem@gmail.com \
    /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.