Patchwork tune/armv7: Add -mthumb to TUNE_CCARGS

login
register
mail settings
Submitter Khem Raj
Date March 25, 2012, 4:48 p.m.
Message ID <1332694123-5078-1-git-send-email-raj.khem@gmail.com>
Download mbox | patch
Permalink /patch/24501/
State New
Headers show

Comments

Khem Raj - March 25, 2012, 4:48 p.m.
armv7 is least common denominator of armv7-a
armv7-m and armv7-r and armv7-m does not support
ARM instructions but only thumb2 instruction set
which means armv7 when chosen will complain if
code is compiled in arm mode which is default
in OE if not specified other wise

Fixes errors like below

error: target CPU does not support ARM mode

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/conf/machine/include/arm/arch-armv7.inc |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Richard Purdie - March 26, 2012, 11:01 a.m.
On Sun, 2012-03-25 at 09:48 -0700, Khem Raj wrote:
> armv7 is least common denominator of armv7-a
> armv7-m and armv7-r and armv7-m does not support
> ARM instructions but only thumb2 instruction set
> which means armv7 when chosen will complain if
> code is compiled in arm mode which is default
> in OE if not specified other wise
> 
> Fixes errors like below
> 
> error: target CPU does not support ARM mode
> 
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  meta/conf/machine/include/arm/arch-armv7.inc |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/meta/conf/machine/include/arm/arch-armv7.inc b/meta/conf/machine/include/arm/arch-armv7.inc
> index 33d9f0d..563a6b4 100644
> --- a/meta/conf/machine/include/arm/arch-armv7.inc
> +++ b/meta/conf/machine/include/arm/arch-armv7.inc
> @@ -4,7 +4,7 @@ ARMPKGARCH ?= "armv7"
>  
>  TUNEVALID[armv7] = "Enable instructions for ARMv7"
>  TUNE_CONFLICTS[armv7] = "armv4 armv5 armv6"
> -TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "armv7", "-march=armv7", "", d)}"
> +TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "armv7", "-march=armv7 -mthumb", "", d)}"
>  MACHINEOVERRIDES .= "${@bb.utils.contains("TUNE_FEATURES", "armv7", ":armv7", "" ,d)}"
>  
>  require conf/machine/include/arm/arch-armv6.inc

Looking at this file, if the above is true and armv7 can't do anything
other than thumb, shouldn't we just delete the non-thumb configurations
for "armv7"?

Adding in "thumb" to the TUNE_FEATURES should add the -mthumb it needs
to work.

Cheers,

Richard
Phil Blundell - March 26, 2012, 11:06 a.m.
On Mon, 2012-03-26 at 12:01 +0100, Richard Purdie wrote:
> Looking at this file, if the above is true and armv7 can't do anything
> other than thumb, shouldn't we just delete the non-thumb configurations
> for "armv7"?

It's not totally obvious to me that having a "lowest common denominator"
configuration for ARMv7 is really all that valuable.  In fact I would be
slightly surprised if anybody is targetting ARMv7-M with OE at all.
What's the use-case for that?

p.
Richard Purdie - March 26, 2012, 11:21 a.m.
On Mon, 2012-03-26 at 12:06 +0100, Phil Blundell wrote:
> On Mon, 2012-03-26 at 12:01 +0100, Richard Purdie wrote:
> > Looking at this file, if the above is true and armv7 can't do anything
> > other than thumb, shouldn't we just delete the non-thumb configurations
> > for "armv7"?
> 
> It's not totally obvious to me that having a "lowest common denominator"
> configuration for ARMv7 is really all that valuable.  In fact I would be
> slightly surprised if anybody is targetting ARMv7-M with OE at all.
> What's the use-case for that?

I have no idea, it appears the file doesn't make a lot of sense...

Cheers,

Richard
Khem Raj - March 26, 2012, 2:13 p.m.
On Mon, Mar 26, 2012 at 4:21 AM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> On Mon, 2012-03-26 at 12:06 +0100, Phil Blundell wrote:
>> On Mon, 2012-03-26 at 12:01 +0100, Richard Purdie wrote:
>> > Looking at this file, if the above is true and armv7 can't do anything
>> > other than thumb, shouldn't we just delete the non-thumb configurations
>> > for "armv7"?
>>
>> It's not totally obvious to me that having a "lowest common denominator"
>> configuration for ARMv7 is really all that valuable.  In fact I would be
>> slightly surprised if anybody is targetting ARMv7-M with OE at all.
>> What's the use-case for that?
>
> I have no idea, it appears the file doesn't make a lot of sense...
>

on second thought I think we should delete this tune file since its
somewhat useless.

> Cheers,
>
> Richard
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Phil Blundell - March 26, 2012, 2:37 p.m.
On Mon, 2012-03-26 at 07:13 -0700, Khem Raj wrote:
> On Mon, Mar 26, 2012 at 4:21 AM, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
> > On Mon, 2012-03-26 at 12:06 +0100, Phil Blundell wrote:
> >> On Mon, 2012-03-26 at 12:01 +0100, Richard Purdie wrote:
> >> > Looking at this file, if the above is true and armv7 can't do anything
> >> > other than thumb, shouldn't we just delete the non-thumb configurations
> >> > for "armv7"?
> >>
> >> It's not totally obvious to me that having a "lowest common denominator"
> >> configuration for ARMv7 is really all that valuable.  In fact I would be
> >> slightly surprised if anybody is targetting ARMv7-M with OE at all.
> >> What's the use-case for that?
> >
> > I have no idea, it appears the file doesn't make a lot of sense...
> >
> 
> on second thought I think we should delete this tune file since its
> somewhat useless.

Yes, agreed.  It looks like Richard added it originally so, if he
doesn't know ( / has forgotten) what it's good for I would guess that
nobody does.

p.
Richard Purdie - March 26, 2012, 3:12 p.m.
On Mon, 2012-03-26 at 15:37 +0100, Phil Blundell wrote:
> On Mon, 2012-03-26 at 07:13 -0700, Khem Raj wrote:
> > On Mon, Mar 26, 2012 at 4:21 AM, Richard Purdie
> > <richard.purdie@linuxfoundation.org> wrote:
> > > On Mon, 2012-03-26 at 12:06 +0100, Phil Blundell wrote:
> > >> On Mon, 2012-03-26 at 12:01 +0100, Richard Purdie wrote:
> > >> > Looking at this file, if the above is true and armv7 can't do anything
> > >> > other than thumb, shouldn't we just delete the non-thumb configurations
> > >> > for "armv7"?
> > >>
> > >> It's not totally obvious to me that having a "lowest common denominator"
> > >> configuration for ARMv7 is really all that valuable.  In fact I would be
> > >> slightly surprised if anybody is targetting ARMv7-M with OE at all.
> > >> What's the use-case for that?
> > >
> > > I have no idea, it appears the file doesn't make a lot of sense...
> > >
> > 
> > on second thought I think we should delete this tune file since its
> > somewhat useless.
> 
> Yes, agreed.  It looks like Richard added it originally so, if he
> doesn't know ( / has forgotten) what it's good for I would guess that
> nobody does.

I was proxy for the tune file rewrite, I wasn't responsible for all the
details. I'm find with removing it assuming nobody objects. I'm cc'ing
Mark in case he remembers anything I don't.

Cheers,

Richard

Patch

diff --git a/meta/conf/machine/include/arm/arch-armv7.inc b/meta/conf/machine/include/arm/arch-armv7.inc
index 33d9f0d..563a6b4 100644
--- a/meta/conf/machine/include/arm/arch-armv7.inc
+++ b/meta/conf/machine/include/arm/arch-armv7.inc
@@ -4,7 +4,7 @@  ARMPKGARCH ?= "armv7"
 
 TUNEVALID[armv7] = "Enable instructions for ARMv7"
 TUNE_CONFLICTS[armv7] = "armv4 armv5 armv6"
-TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "armv7", "-march=armv7", "", d)}"
+TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "armv7", "-march=armv7 -mthumb", "", d)}"
 MACHINEOVERRIDES .= "${@bb.utils.contains("TUNE_FEATURES", "armv7", ":armv7", "" ,d)}"
 
 require conf/machine/include/arm/arch-armv6.inc