All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sane-toolchain-*: add -g to FULL_OPTIMIZATION to make -dbg packages more usefull
@ 2011-03-01  9:10 Martin Jansa
  2011-03-01 11:15 ` Otavio Salvador
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Martin Jansa @ 2011-03-01  9:10 UTC (permalink / raw)
  To: openembedded-devel

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 conf/distro/include/sane-toolchain-eglibc.inc      |   12 ++++++------
 conf/distro/include/sane-toolchain-glibc.inc       |   10 +++++-----
 conf/distro/include/sane-toolchain-uclibc.inc      |    6 +++---
 .../include/sane-toolchain-uclinux-uclibc.inc      |    2 +-
 4 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/conf/distro/include/sane-toolchain-eglibc.inc b/conf/distro/include/sane-toolchain-eglibc.inc
index daab0f8..e22976f 100644
--- a/conf/distro/include/sane-toolchain-eglibc.inc
+++ b/conf/distro/include/sane-toolchain-eglibc.inc
@@ -3,20 +3,20 @@
 # eglibc:
 # [23:00] oxo: glibc (any version) on sparc does not like (repeat me) "-Os"
 
-FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -Os"
-FULL_OPTIMIZATION_pn-perl = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O1"
-FULL_OPTIMIZATION_sparc = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2"
+FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -Os -g"
+FULL_OPTIMIZATION_pn-perl = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O1 -g"
+FULL_OPTIMIZATION_sparc = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 -g"
 
 # gcc 4.4 and 4.5 has a problem with 'leakage' into libgcc.a with -Os
-FULL_OPTIMIZATION_powerpc = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2"
+FULL_OPTIMIZATION_powerpc = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 -g"
 
 # JaMa: I promise to report bug upstream, but as it can take a while to fix it, I'll switch to -O2 here
 # Tested with gcc-4.4.2 and gcc-4.4.3 on armv4t and armv5te and it fails with -Os, with gcc-4.3.3 it works OK with -Os
 # Here is testcase, but you have to rebuild whole libqtxml to test it
 # http://lists.shr-project.org/pipermail/shr-devel/2010-February/002169.html
-FULL_OPTIMIZATION_pn-qt4-x11-free = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2"
+FULL_OPTIMIZATION_pn-qt4-x11-free = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 -g"
 # This I've seen only on armv4t, it segfaults when called from pisi, but whole test unit suite can pass
-FULL_OPTIMIZATION_pn-libsyncml = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2"
+FULL_OPTIMIZATION_pn-libsyncml = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 -g"
 
 BUILD_OPTIMIZATION_pn-perl = "-O1"
 BUILD_OPTIMIZATION_sparc = "-O2"
diff --git a/conf/distro/include/sane-toolchain-glibc.inc b/conf/distro/include/sane-toolchain-glibc.inc
index 770aa87..09b88b6 100644
--- a/conf/distro/include/sane-toolchain-glibc.inc
+++ b/conf/distro/include/sane-toolchain-glibc.inc
@@ -7,14 +7,14 @@
 # perl has some problems, see http://bugs.openembedded.net/show_bug.cgi?id=1616
 # [23:00] oxo: glibc (any version) on sparc does not like (repeat me) "-Os"
 
-FULL_OPTIMIZATION = "-fexpensive-optimizations -frename-registers -fomit-frame-pointer -O2"
+FULL_OPTIMIZATION = "-fexpensive-optimizations -frename-registers -fomit-frame-pointer -O2 -g"
 
-FULL_OPTIMIZATION_pn-perl = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O1"
-FULL_OPTIMIZATION_pn-glibc = "-fexpensive-optimizations -fomit-frame-pointer -O2"
-FULL_OPTIMIZATION_sparc = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2"
+FULL_OPTIMIZATION_pn-perl = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O1 -g"
+FULL_OPTIMIZATION_pn-glibc = "-fexpensive-optimizations -fomit-frame-pointer -O2 -g"
+FULL_OPTIMIZATION_sparc = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 -g"
 
 # gcc 4.4 and 4.5 has a problem with 'leakage' into libgcc.a with -Os
-FULL_OPTIMIZATION_powerpc = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2"
+FULL_OPTIMIZATION_powerpc = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 -g"
 
 BUILD_OPTIMIZATION_pn-perl = "-O1"
 BUILD_OPTIMIZATION_pn-glibc = "-O2"
diff --git a/conf/distro/include/sane-toolchain-uclibc.inc b/conf/distro/include/sane-toolchain-uclibc.inc
index b61ee36..acb843c 100644
--- a/conf/distro/include/sane-toolchain-uclibc.inc
+++ b/conf/distro/include/sane-toolchain-uclibc.inc
@@ -23,12 +23,12 @@ PREFERRED_VERSION_uclibc-cross-intermediate ?= "${PREFERRED_UCLIBC_VERSION}"
 
 #mess with compiler flags to use -Os instead of -O2
 #Please see http://free-electrons.com/doc/embedded_linux_optimizations/img47.html for some more info
-FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -Os -pipe"
+FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -Os -pipe -g"
 BUILD_OPTIMIZATION += "-pipe"
 
 # -Os compiled root file system does not boot for powerpc, root cause it still at large
 # we use -O2 meanwhile
-FULL_OPTIMIZATION_powerpc = "-O2 -pipe"
+FULL_OPTIMIZATION_powerpc = "-O2 -pipe -g"
 
 #Gcc will die with 'internal consistency error when using the above optimizations
 #with gcc-4.2.1-atmel.1.0.3 (and probably most other avr32 gcc ports).
@@ -38,7 +38,7 @@ FULL_OPTIMIZATION_powerpc = "-O2 -pipe"
 #it was removed while debugging an issue that ultimately turned out to be due
 #to the ICE fixed by gcc-pr32889.patch.  It needs to be tested again. 
 #Note that this testing was done without the gcc-pr32889.patch.
-FULL_OPTIMIZATION_avr32 = "-Os -fomit-frame-pointer"
+FULL_OPTIMIZATION_avr32 = "-Os -fomit-frame-pointer -g"
 
 TARGET_LINK_HASH_STYLE = "${@['-Wl,--hash-style=gnu',''][bb.data.getVar('TARGET_ARCH',d,1) in ['mips', 'mipsel', 'mips64', 'mips64el', 'avr32']]}"
 
diff --git a/conf/distro/include/sane-toolchain-uclinux-uclibc.inc b/conf/distro/include/sane-toolchain-uclinux-uclibc.inc
index a1e7df0..9490084 100644
--- a/conf/distro/include/sane-toolchain-uclinux-uclibc.inc
+++ b/conf/distro/include/sane-toolchain-uclinux-uclibc.inc
@@ -9,7 +9,7 @@ USE_NLS_gcc-cross = "no"
 
 #mess with compiler flags to use -Os instead of -O2
 #Please see http://free-electrons.com/doc/embedded_linux_optimizations/img47.html for some more info
-FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -Os -pipe"
+FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -Os -pipe -g"
 BUILD_OPTIMIZATION = "-Os"
 
 #Gcc will die with 'internal consistency error when using the above optimizations
-- 
1.7.4.1




^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH] sane-toolchain-*: add -g to FULL_OPTIMIZATION to make -dbg packages more usefull
  2011-03-01  9:10 [PATCH] sane-toolchain-*: add -g to FULL_OPTIMIZATION to make -dbg packages more usefull Martin Jansa
@ 2011-03-01 11:15 ` Otavio Salvador
  2011-03-01 16:07 ` Tom Rini
  2011-03-02 19:55 ` [PATCHv2] sane-toolchain-*: define DEBUG_FLAGS and add it " Martin Jansa
  2 siblings, 0 replies; 16+ messages in thread
From: Otavio Salvador @ 2011-03-01 11:15 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Martin Jansa

On Tue, Mar 1, 2011 at 09:10, Martin Jansa <martin.jansa@gmail.com> wrote:
> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> ---
>  conf/distro/include/sane-toolchain-eglibc.inc      |   12 ++++++------
>  conf/distro/include/sane-toolchain-glibc.inc       |   10 +++++-----
>  conf/distro/include/sane-toolchain-uclibc.inc      |    6 +++---
>  .../include/sane-toolchain-uclinux-uclibc.inc      |    2 +-
>  4 files changed, 15 insertions(+), 15 deletions(-)

Acked-by: Otavio Salvador <otavio@ossystems.com.br>

-- 
Otavio Salvador                             O.S. Systems
E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] sane-toolchain-*: add -g to FULL_OPTIMIZATION to make -dbg packages more usefull
  2011-03-01  9:10 [PATCH] sane-toolchain-*: add -g to FULL_OPTIMIZATION to make -dbg packages more usefull Martin Jansa
  2011-03-01 11:15 ` Otavio Salvador
@ 2011-03-01 16:07 ` Tom Rini
  2011-03-01 17:03   ` Otavio Salvador
  2011-03-02 19:55 ` [PATCHv2] sane-toolchain-*: define DEBUG_FLAGS and add it " Martin Jansa
  2 siblings, 1 reply; 16+ messages in thread
From: Tom Rini @ 2011-03-01 16:07 UTC (permalink / raw)
  To: openembedded-devel

On 03/01/2011 02:10 AM, Martin Jansa wrote:
> Signed-off-by: Martin Jansa<Martin.Jansa@gmail.com>
> ---
>   conf/distro/include/sane-toolchain-eglibc.inc      |   12 ++++++------
>   conf/distro/include/sane-toolchain-glibc.inc       |   10 +++++-----
>   conf/distro/include/sane-toolchain-uclibc.inc      |    6 +++---
>   .../include/sane-toolchain-uclinux-uclibc.inc      |    2 +-
>   4 files changed, 15 insertions(+), 15 deletions(-)

While we're in here, we should look at what the angstrom ones do 
correctly which is that BUILD_OPTIMIZATION is only for -native recipes.

And personally I'd like to see the -g flag (for both target and the 
rest) be a variable that can be tweaked as needed (for more or less 
debug in the area).

-- 
Tom Rini
Mentor Graphics Corporation



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] sane-toolchain-*: add -g to FULL_OPTIMIZATION to make -dbg packages more usefull
  2011-03-01 16:07 ` Tom Rini
@ 2011-03-01 17:03   ` Otavio Salvador
  2011-03-01 17:39     ` Tom Rini
  0 siblings, 1 reply; 16+ messages in thread
From: Otavio Salvador @ 2011-03-01 17:03 UTC (permalink / raw)
  To: openembedded-devel

On Tue, Mar 1, 2011 at 16:07, Tom Rini <tom_rini@mentor.com> wrote:
> On 03/01/2011 02:10 AM, Martin Jansa wrote:
...
> And personally I'd like to see the -g flag (for both target and the rest) be
> a variable that can be tweaked as needed (for more or less debug in the
> area).

Having -g shouldn't hurt since the debugging symbols end up on the
-dbg packages. Why having it "disabled" by default?

-- 
Otavio Salvador                             O.S. Systems
E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] sane-toolchain-*: add -g to FULL_OPTIMIZATION to make -dbg packages more usefull
  2011-03-01 17:03   ` Otavio Salvador
@ 2011-03-01 17:39     ` Tom Rini
  2011-03-01 17:50       ` Otavio Salvador
  0 siblings, 1 reply; 16+ messages in thread
From: Tom Rini @ 2011-03-01 17:39 UTC (permalink / raw)
  To: Otavio Salvador; +Cc: openembedded-devel

On 03/01/2011 10:03 AM, Otavio Salvador wrote:
> On Tue, Mar 1, 2011 at 16:07, Tom Rini<tom_rini@mentor.com>  wrote:
>> On 03/01/2011 02:10 AM, Martin Jansa wrote:
> ...
>> And personally I'd like to see the -g flag (for both target and the rest) be
>> a variable that can be tweaked as needed (for more or less debug in the
>> area).
>
> Having -g shouldn't hurt since the debugging symbols end up on the
> -dbg packages. Why having it "disabled" by default?

In the case of host packages, I disable debug symbols (don't want, takes 
up space when shipping).  In the case of target stuff, we may want more 
debug info to be available.  Or one may want to have less because again, 
it takes up space when shipping.

-- 
Tom Rini
Mentor Graphics Corporation



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] sane-toolchain-*: add -g to FULL_OPTIMIZATION to make -dbg packages more usefull
  2011-03-01 17:39     ` Tom Rini
@ 2011-03-01 17:50       ` Otavio Salvador
  2011-03-01 17:54         ` Tom Rini
  0 siblings, 1 reply; 16+ messages in thread
From: Otavio Salvador @ 2011-03-01 17:50 UTC (permalink / raw)
  To: Tom Rini; +Cc: openembedded-devel

On Tue, Mar 1, 2011 at 17:39, Tom Rini <tom_rini@mentor.com> wrote:
> On 03/01/2011 10:03 AM, Otavio Salvador wrote:
>> Having -g shouldn't hurt since the debugging symbols end up on the
>> -dbg packages. Why having it "disabled" by default?
>
> In the case of host packages, I disable debug symbols (don't want, takes up
> space when shipping).  In the case of target stuff, we may want more debug
> info to be available.  Or one may want to have less because again, it takes
> up space when shipping.

I see but this could be overriden by distro, couldn't it?

-- 
Otavio Salvador                             O.S. Systems
E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] sane-toolchain-*: add -g to FULL_OPTIMIZATION to make -dbg packages more usefull
  2011-03-01 17:50       ` Otavio Salvador
@ 2011-03-01 17:54         ` Tom Rini
  2011-03-01 18:10           ` Phil Blundell
  0 siblings, 1 reply; 16+ messages in thread
From: Tom Rini @ 2011-03-01 17:54 UTC (permalink / raw)
  To: Otavio Salvador; +Cc: openembedded-devel

On 03/01/2011 10:50 AM, Otavio Salvador wrote:
> On Tue, Mar 1, 2011 at 17:39, Tom Rini<tom_rini@mentor.com>  wrote:
>> On 03/01/2011 10:03 AM, Otavio Salvador wrote:
>>> Having -g shouldn't hurt since the debugging symbols end up on the
>>> -dbg packages. Why having it "disabled" by default?
>>
>> In the case of host packages, I disable debug symbols (don't want, takes up
>> space when shipping).  In the case of target stuff, we may want more debug
>> info to be available.  Or one may want to have less because again, it takes
>> up space when shipping.
>
> I see but this could be overriden by distro, couldn't it?

That's why I'm asking for the -g part to be put into a variable so that 
it can be overriden easily, in all cases, without needing to know the 
special cases (ie glibc).

-- 
Tom Rini
Mentor Graphics Corporation



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] sane-toolchain-*: add -g to FULL_OPTIMIZATION to make -dbg packages more usefull
  2011-03-01 17:54         ` Tom Rini
@ 2011-03-01 18:10           ` Phil Blundell
  2011-03-01 18:29             ` Tom Rini
  0 siblings, 1 reply; 16+ messages in thread
From: Phil Blundell @ 2011-03-01 18:10 UTC (permalink / raw)
  To: openembedded-devel

On Tue, 2011-03-01 at 10:54 -0700, Tom Rini wrote:
> That's why I'm asking for the -g part to be put into a variable so that 
> it can be overriden easily, in all cases, without needing to know the 
> special cases (ie glibc).

Why is glibc special anyway (or, why is the optimization in a
libc-specific conf file)?  It seems a bit bogus that the choice of your
C library would be having such a global impact on the compiler flags for
everything else.

p.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] sane-toolchain-*: add -g to FULL_OPTIMIZATION to make -dbg packages more usefull
  2011-03-01 18:10           ` Phil Blundell
@ 2011-03-01 18:29             ` Tom Rini
  2011-03-01 19:14               ` Khem Raj
  2011-03-01 20:17               ` Phil Blundell
  0 siblings, 2 replies; 16+ messages in thread
From: Tom Rini @ 2011-03-01 18:29 UTC (permalink / raw)
  To: openembedded-devel

On 03/01/2011 11:10 AM, Phil Blundell wrote:
> On Tue, 2011-03-01 at 10:54 -0700, Tom Rini wrote:
>> That's why I'm asking for the -g part to be put into a variable so that
>> it can be overriden easily, in all cases, without needing to know the
>> special cases (ie glibc).
>
> Why is glibc special anyway (or, why is the optimization in a
> libc-specific conf file)?  It seems a bit bogus that the choice of your
> C library would be having such a global impact on the compiler flags for
> everything else.

There is some odd papering over that's going on to switch out a flag or 
two (and force -O2) for glibc (but not eglibc).  But my point is that 
today we have a few special case FULL_OPTIMIZATION_pn-'s and it'd be 
great to just not have to worry about that when setting the debug level 
we build with.

-- 
Tom Rini
Mentor Graphics Corporation



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] sane-toolchain-*: add -g to FULL_OPTIMIZATION to make -dbg packages more usefull
  2011-03-01 18:29             ` Tom Rini
@ 2011-03-01 19:14               ` Khem Raj
  2011-03-01 19:33                 ` Tom Rini
  2011-03-01 20:17               ` Phil Blundell
  1 sibling, 1 reply; 16+ messages in thread
From: Khem Raj @ 2011-03-01 19:14 UTC (permalink / raw)
  To: openembedded-devel

On Tue, Mar 1, 2011 at 10:29 AM, Tom Rini <tom_rini@mentor.com> wrote:
> On 03/01/2011 11:10 AM, Phil Blundell wrote:
>>
>> On Tue, 2011-03-01 at 10:54 -0700, Tom Rini wrote:
>>>
>>> That's why I'm asking for the -g part to be put into a variable so that
>>> it can be overriden easily, in all cases, without needing to know the
>>> special cases (ie glibc).
>>
>> Why is glibc special anyway (or, why is the optimization in a
>> libc-specific conf file)?  It seems a bit bogus that the choice of your
>> C library would be having such a global impact on the compiler flags for
>> everything else.
>
> There is some odd papering over that's going on to switch out a flag or two
> (and force -O2) for glibc (but not eglibc).  But my point is that today we
> have a few special case FULL_OPTIMIZATION_pn-'s and it'd be great to just
> not have to worry about that when setting the debug level we build with.
>

May be debugability can be expressed via another variable say
DEBUG_FLAGS or somesuch which can then we appended to global CFLAGS

> --
> Tom Rini
> Mentor Graphics Corporation
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
>



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] sane-toolchain-*: add -g to FULL_OPTIMIZATION to make -dbg packages more usefull
  2011-03-01 19:14               ` Khem Raj
@ 2011-03-01 19:33                 ` Tom Rini
  2011-03-01 19:37                   ` Khem Raj
  0 siblings, 1 reply; 16+ messages in thread
From: Tom Rini @ 2011-03-01 19:33 UTC (permalink / raw)
  To: Khem Raj; +Cc: openembedded-devel

On 03/01/2011 12:14 PM, Khem Raj wrote:
> On Tue, Mar 1, 2011 at 10:29 AM, Tom Rini<tom_rini@mentor.com>  wrote:
>> On 03/01/2011 11:10 AM, Phil Blundell wrote:
>>>
>>> On Tue, 2011-03-01 at 10:54 -0700, Tom Rini wrote:
>>>>
>>>> That's why I'm asking for the -g part to be put into a variable so that
>>>> it can be overriden easily, in all cases, without needing to know the
>>>> special cases (ie glibc).
>>>
>>> Why is glibc special anyway (or, why is the optimization in a
>>> libc-specific conf file)?  It seems a bit bogus that the choice of your
>>> C library would be having such a global impact on the compiler flags for
>>> everything else.
>>
>> There is some odd papering over that's going on to switch out a flag or two
>> (and force -O2) for glibc (but not eglibc).  But my point is that today we
>> have a few special case FULL_OPTIMIZATION_pn-'s and it'd be great to just
>> not have to worry about that when setting the debug level we build with.
>>
>
> May be debugability can be expressed via another variable say
> DEBUG_FLAGS or somesuch which can then we appended to global CFLAGS

With the caveat that I want to control native vs target at different 
levels, yes.

-- 
Tom Rini
Mentor Graphics Corporation



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] sane-toolchain-*: add -g to FULL_OPTIMIZATION to make -dbg packages more usefull
  2011-03-01 19:33                 ` Tom Rini
@ 2011-03-01 19:37                   ` Khem Raj
  0 siblings, 0 replies; 16+ messages in thread
From: Khem Raj @ 2011-03-01 19:37 UTC (permalink / raw)
  To: Tom Rini; +Cc: openembedded-devel

On Tue, Mar 1, 2011 at 11:33 AM, Tom Rini <tom_rini@mentor.com> wrote:
> On 03/01/2011 12:14 PM, Khem Raj wrote:
>>
>> On Tue, Mar 1, 2011 at 10:29 AM, Tom Rini<tom_rini@mentor.com>  wrote:
>>>
>>> On 03/01/2011 11:10 AM, Phil Blundell wrote:
>>>>
>>>> On Tue, 2011-03-01 at 10:54 -0700, Tom Rini wrote:
>>>>>
>>>>> That's why I'm asking for the -g part to be put into a variable so that
>>>>> it can be overriden easily, in all cases, without needing to know the
>>>>> special cases (ie glibc).
>>>>
>>>> Why is glibc special anyway (or, why is the optimization in a
>>>> libc-specific conf file)?  It seems a bit bogus that the choice of your
>>>> C library would be having such a global impact on the compiler flags for
>>>> everything else.
>>>
>>> There is some odd papering over that's going on to switch out a flag or
>>> two
>>> (and force -O2) for glibc (but not eglibc).  But my point is that today
>>> we
>>> have a few special case FULL_OPTIMIZATION_pn-'s and it'd be great to just
>>> not have to worry about that when setting the debug level we build with.
>>>
>>
>> May be debugability can be expressed via another variable say
>> DEBUG_FLAGS or somesuch which can then we appended to global CFLAGS
>
> With the caveat that I want to control native vs target at different levels,
> yes.

we can have a native counter part or calculate it using native override

>
> --
> Tom Rini
> Mentor Graphics Corporation
>



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] sane-toolchain-*: add -g to FULL_OPTIMIZATION to make -dbg packages more usefull
  2011-03-01 18:29             ` Tom Rini
  2011-03-01 19:14               ` Khem Raj
@ 2011-03-01 20:17               ` Phil Blundell
  1 sibling, 0 replies; 16+ messages in thread
From: Phil Blundell @ 2011-03-01 20:17 UTC (permalink / raw)
  To: openembedded-devel

On Tue, 2011-03-01 at 11:29 -0700, Tom Rini wrote:
> But my point is that 
> today we have a few special case FULL_OPTIMIZATION_pn-'s and it'd be 
> great to just not have to worry about that when setting the debug level 
> we build with.

Yeah, agreed.  Debugging is only tangentially related to optimization
and having the two things conflated in one variable is a bit of an
anachronism.  It certainly would be good to have that separated out in
some cleaner way.

p.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCHv2] sane-toolchain-*: define DEBUG_FLAGS and add it to FULL_OPTIMIZATION to make -dbg packages more usefull
  2011-03-01  9:10 [PATCH] sane-toolchain-*: add -g to FULL_OPTIMIZATION to make -dbg packages more usefull Martin Jansa
  2011-03-01 11:15 ` Otavio Salvador
  2011-03-01 16:07 ` Tom Rini
@ 2011-03-02 19:55 ` Martin Jansa
  2011-03-02 22:29   ` Tom Rini
  2011-03-02 23:22   ` Khem Raj
  2 siblings, 2 replies; 16+ messages in thread
From: Martin Jansa @ 2011-03-02 19:55 UTC (permalink / raw)
  To: openembedded-devel

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 conf/bitbake.conf                                  |    5 +++--
 conf/distro/include/sane-toolchain-eglibc.inc      |   12 ++++++------
 conf/distro/include/sane-toolchain-glibc.inc       |   10 +++++-----
 conf/distro/include/sane-toolchain-uclibc.inc      |    6 +++---
 .../include/sane-toolchain-uclinux-uclibc.inc      |    2 +-
 5 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/conf/bitbake.conf b/conf/bitbake.conf
index 0c11cdb..f23dd05 100644
--- a/conf/bitbake.conf
+++ b/conf/bitbake.conf
@@ -543,10 +543,11 @@ EXTRA_OEMAKE_prepend_task-compile = "${PARALLEL_MAKE} "
 # Optimization flags.
 ##################################################################
 
+DEBUG_FLAGS = "-g"
 FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2"
-DEBUG_OPTIMIZATION = "-O -fno-omit-frame-pointer -g"
+DEBUG_OPTIMIZATION = "-O -fno-omit-frame-pointer ${DEBUG_FLAGS}"
 SELECTED_OPTIMIZATION = "${@bb.data.getVar(['FULL_OPTIMIZATION', 'DEBUG_OPTIMIZATION'][bb.data.getVar('DEBUG_BUILD', d, 1) == '1'], d, 1)}"
-BUILD_OPTIMIZATION = "-O2 -g"
+BUILD_OPTIMIZATION = "-O2 ${DEBUG_FLAGS}"
 
 ##################################################################
 # Bootstrap stuff.
diff --git a/conf/distro/include/sane-toolchain-eglibc.inc b/conf/distro/include/sane-toolchain-eglibc.inc
index daab0f8..d38ca5d 100644
--- a/conf/distro/include/sane-toolchain-eglibc.inc
+++ b/conf/distro/include/sane-toolchain-eglibc.inc
@@ -3,20 +3,20 @@
 # eglibc:
 # [23:00] oxo: glibc (any version) on sparc does not like (repeat me) "-Os"
 
-FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -Os"
-FULL_OPTIMIZATION_pn-perl = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O1"
-FULL_OPTIMIZATION_sparc = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2"
+FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -Os ${DEBUG_FLAGS}"
+FULL_OPTIMIZATION_pn-perl = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O1 ${DEBUG_FLAGS}"
+FULL_OPTIMIZATION_sparc = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 ${DEBUG_FLAGS}"
 
 # gcc 4.4 and 4.5 has a problem with 'leakage' into libgcc.a with -Os
-FULL_OPTIMIZATION_powerpc = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2"
+FULL_OPTIMIZATION_powerpc = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 ${DEBUG_FLAGS}"
 
 # JaMa: I promise to report bug upstream, but as it can take a while to fix it, I'll switch to -O2 here
 # Tested with gcc-4.4.2 and gcc-4.4.3 on armv4t and armv5te and it fails with -Os, with gcc-4.3.3 it works OK with -Os
 # Here is testcase, but you have to rebuild whole libqtxml to test it
 # http://lists.shr-project.org/pipermail/shr-devel/2010-February/002169.html
-FULL_OPTIMIZATION_pn-qt4-x11-free = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2"
+FULL_OPTIMIZATION_pn-qt4-x11-free = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 ${DEBUG_FLAGS}"
 # This I've seen only on armv4t, it segfaults when called from pisi, but whole test unit suite can pass
-FULL_OPTIMIZATION_pn-libsyncml = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2"
+FULL_OPTIMIZATION_pn-libsyncml = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 ${DEBUG_FLAGS}"
 
 BUILD_OPTIMIZATION_pn-perl = "-O1"
 BUILD_OPTIMIZATION_sparc = "-O2"
diff --git a/conf/distro/include/sane-toolchain-glibc.inc b/conf/distro/include/sane-toolchain-glibc.inc
index 770aa87..29c201b 100644
--- a/conf/distro/include/sane-toolchain-glibc.inc
+++ b/conf/distro/include/sane-toolchain-glibc.inc
@@ -7,14 +7,14 @@
 # perl has some problems, see http://bugs.openembedded.net/show_bug.cgi?id=1616
 # [23:00] oxo: glibc (any version) on sparc does not like (repeat me) "-Os"
 
-FULL_OPTIMIZATION = "-fexpensive-optimizations -frename-registers -fomit-frame-pointer -O2"
+FULL_OPTIMIZATION = "-fexpensive-optimizations -frename-registers -fomit-frame-pointer -O2 ${DEBUG_FLAGS}"
 
-FULL_OPTIMIZATION_pn-perl = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O1"
-FULL_OPTIMIZATION_pn-glibc = "-fexpensive-optimizations -fomit-frame-pointer -O2"
-FULL_OPTIMIZATION_sparc = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2"
+FULL_OPTIMIZATION_pn-perl = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O1 ${DEBUG_FLAGS}"
+FULL_OPTIMIZATION_pn-glibc = "-fexpensive-optimizations -fomit-frame-pointer -O2 ${DEBUG_FLAGS}"
+FULL_OPTIMIZATION_sparc = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 ${DEBUG_FLAGS}"
 
 # gcc 4.4 and 4.5 has a problem with 'leakage' into libgcc.a with -Os
-FULL_OPTIMIZATION_powerpc = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2"
+FULL_OPTIMIZATION_powerpc = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 ${DEBUG_FLAGS}"
 
 BUILD_OPTIMIZATION_pn-perl = "-O1"
 BUILD_OPTIMIZATION_pn-glibc = "-O2"
diff --git a/conf/distro/include/sane-toolchain-uclibc.inc b/conf/distro/include/sane-toolchain-uclibc.inc
index b61ee36..b51cdaf 100644
--- a/conf/distro/include/sane-toolchain-uclibc.inc
+++ b/conf/distro/include/sane-toolchain-uclibc.inc
@@ -23,12 +23,12 @@ PREFERRED_VERSION_uclibc-cross-intermediate ?= "${PREFERRED_UCLIBC_VERSION}"
 
 #mess with compiler flags to use -Os instead of -O2
 #Please see http://free-electrons.com/doc/embedded_linux_optimizations/img47.html for some more info
-FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -Os -pipe"
+FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -Os -pipe ${DEBUG_FLAGS}"
 BUILD_OPTIMIZATION += "-pipe"
 
 # -Os compiled root file system does not boot for powerpc, root cause it still at large
 # we use -O2 meanwhile
-FULL_OPTIMIZATION_powerpc = "-O2 -pipe"
+FULL_OPTIMIZATION_powerpc = "-O2 -pipe ${DEBUG_FLAGS}"
 
 #Gcc will die with 'internal consistency error when using the above optimizations
 #with gcc-4.2.1-atmel.1.0.3 (and probably most other avr32 gcc ports).
@@ -38,7 +38,7 @@ FULL_OPTIMIZATION_powerpc = "-O2 -pipe"
 #it was removed while debugging an issue that ultimately turned out to be due
 #to the ICE fixed by gcc-pr32889.patch.  It needs to be tested again. 
 #Note that this testing was done without the gcc-pr32889.patch.
-FULL_OPTIMIZATION_avr32 = "-Os -fomit-frame-pointer"
+FULL_OPTIMIZATION_avr32 = "-Os -fomit-frame-pointer ${DEBUG_FLAGS}"
 
 TARGET_LINK_HASH_STYLE = "${@['-Wl,--hash-style=gnu',''][bb.data.getVar('TARGET_ARCH',d,1) in ['mips', 'mipsel', 'mips64', 'mips64el', 'avr32']]}"
 
diff --git a/conf/distro/include/sane-toolchain-uclinux-uclibc.inc b/conf/distro/include/sane-toolchain-uclinux-uclibc.inc
index a1e7df0..8ebaf15 100644
--- a/conf/distro/include/sane-toolchain-uclinux-uclibc.inc
+++ b/conf/distro/include/sane-toolchain-uclinux-uclibc.inc
@@ -9,7 +9,7 @@ USE_NLS_gcc-cross = "no"
 
 #mess with compiler flags to use -Os instead of -O2
 #Please see http://free-electrons.com/doc/embedded_linux_optimizations/img47.html for some more info
-FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -Os -pipe"
+FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -Os -pipe ${DEBUG_FLAGS}"
 BUILD_OPTIMIZATION = "-Os"
 
 #Gcc will die with 'internal consistency error when using the above optimizations
-- 
1.7.4.1




^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCHv2] sane-toolchain-*: define DEBUG_FLAGS and add it to FULL_OPTIMIZATION to make -dbg packages more usefull
  2011-03-02 19:55 ` [PATCHv2] sane-toolchain-*: define DEBUG_FLAGS and add it " Martin Jansa
@ 2011-03-02 22:29   ` Tom Rini
  2011-03-02 23:22   ` Khem Raj
  1 sibling, 0 replies; 16+ messages in thread
From: Tom Rini @ 2011-03-02 22:29 UTC (permalink / raw)
  To: openembedded-devel

On 03/02/2011 12:55 PM, Martin Jansa wrote:
> Signed-off-by: Martin Jansa<Martin.Jansa@gmail.com>

Acked-by: Tom Rini <tom_rini@mentor.com>

> ---
>   conf/bitbake.conf                                  |    5 +++--
>   conf/distro/include/sane-toolchain-eglibc.inc      |   12 ++++++------
>   conf/distro/include/sane-toolchain-glibc.inc       |   10 +++++-----
>   conf/distro/include/sane-toolchain-uclibc.inc      |    6 +++---
>   .../include/sane-toolchain-uclinux-uclibc.inc      |    2 +-
>   5 files changed, 18 insertions(+), 17 deletions(-)
>
> diff --git a/conf/bitbake.conf b/conf/bitbake.conf
> index 0c11cdb..f23dd05 100644
> --- a/conf/bitbake.conf
> +++ b/conf/bitbake.conf
> @@ -543,10 +543,11 @@ EXTRA_OEMAKE_prepend_task-compile = "${PARALLEL_MAKE} "
>   # Optimization flags.
>   ##################################################################
>
> +DEBUG_FLAGS = "-g"
>   FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2"
> -DEBUG_OPTIMIZATION = "-O -fno-omit-frame-pointer -g"
> +DEBUG_OPTIMIZATION = "-O -fno-omit-frame-pointer ${DEBUG_FLAGS}"
>   SELECTED_OPTIMIZATION = "${@bb.data.getVar(['FULL_OPTIMIZATION', 'DEBUG_OPTIMIZATION'][bb.data.getVar('DEBUG_BUILD', d, 1) == '1'], d, 1)}"
> -BUILD_OPTIMIZATION = "-O2 -g"
> +BUILD_OPTIMIZATION = "-O2 ${DEBUG_FLAGS}"
>
>   ##################################################################
>   # Bootstrap stuff.
> diff --git a/conf/distro/include/sane-toolchain-eglibc.inc b/conf/distro/include/sane-toolchain-eglibc.inc
> index daab0f8..d38ca5d 100644
> --- a/conf/distro/include/sane-toolchain-eglibc.inc
> +++ b/conf/distro/include/sane-toolchain-eglibc.inc
> @@ -3,20 +3,20 @@
>   # eglibc:
>   # [23:00] oxo: glibc (any version) on sparc does not like (repeat me) "-Os"
>
> -FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -Os"
> -FULL_OPTIMIZATION_pn-perl = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O1"
> -FULL_OPTIMIZATION_sparc = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2"
> +FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -Os ${DEBUG_FLAGS}"
> +FULL_OPTIMIZATION_pn-perl = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O1 ${DEBUG_FLAGS}"
> +FULL_OPTIMIZATION_sparc = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 ${DEBUG_FLAGS}"
>
>   # gcc 4.4 and 4.5 has a problem with 'leakage' into libgcc.a with -Os
> -FULL_OPTIMIZATION_powerpc = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2"
> +FULL_OPTIMIZATION_powerpc = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 ${DEBUG_FLAGS}"
>
>   # JaMa: I promise to report bug upstream, but as it can take a while to fix it, I'll switch to -O2 here
>   # Tested with gcc-4.4.2 and gcc-4.4.3 on armv4t and armv5te and it fails with -Os, with gcc-4.3.3 it works OK with -Os
>   # Here is testcase, but you have to rebuild whole libqtxml to test it
>   # http://lists.shr-project.org/pipermail/shr-devel/2010-February/002169.html
> -FULL_OPTIMIZATION_pn-qt4-x11-free = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2"
> +FULL_OPTIMIZATION_pn-qt4-x11-free = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 ${DEBUG_FLAGS}"
>   # This I've seen only on armv4t, it segfaults when called from pisi, but whole test unit suite can pass
> -FULL_OPTIMIZATION_pn-libsyncml = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2"
> +FULL_OPTIMIZATION_pn-libsyncml = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 ${DEBUG_FLAGS}"
>
>   BUILD_OPTIMIZATION_pn-perl = "-O1"
>   BUILD_OPTIMIZATION_sparc = "-O2"
> diff --git a/conf/distro/include/sane-toolchain-glibc.inc b/conf/distro/include/sane-toolchain-glibc.inc
> index 770aa87..29c201b 100644
> --- a/conf/distro/include/sane-toolchain-glibc.inc
> +++ b/conf/distro/include/sane-toolchain-glibc.inc
> @@ -7,14 +7,14 @@
>   # perl has some problems, see http://bugs.openembedded.net/show_bug.cgi?id=1616
>   # [23:00] oxo: glibc (any version) on sparc does not like (repeat me) "-Os"
>
> -FULL_OPTIMIZATION = "-fexpensive-optimizations -frename-registers -fomit-frame-pointer -O2"
> +FULL_OPTIMIZATION = "-fexpensive-optimizations -frename-registers -fomit-frame-pointer -O2 ${DEBUG_FLAGS}"
>
> -FULL_OPTIMIZATION_pn-perl = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O1"
> -FULL_OPTIMIZATION_pn-glibc = "-fexpensive-optimizations -fomit-frame-pointer -O2"
> -FULL_OPTIMIZATION_sparc = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2"
> +FULL_OPTIMIZATION_pn-perl = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O1 ${DEBUG_FLAGS}"
> +FULL_OPTIMIZATION_pn-glibc = "-fexpensive-optimizations -fomit-frame-pointer -O2 ${DEBUG_FLAGS}"
> +FULL_OPTIMIZATION_sparc = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 ${DEBUG_FLAGS}"
>
>   # gcc 4.4 and 4.5 has a problem with 'leakage' into libgcc.a with -Os
> -FULL_OPTIMIZATION_powerpc = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2"
> +FULL_OPTIMIZATION_powerpc = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 ${DEBUG_FLAGS}"
>
>   BUILD_OPTIMIZATION_pn-perl = "-O1"
>   BUILD_OPTIMIZATION_pn-glibc = "-O2"
> diff --git a/conf/distro/include/sane-toolchain-uclibc.inc b/conf/distro/include/sane-toolchain-uclibc.inc
> index b61ee36..b51cdaf 100644
> --- a/conf/distro/include/sane-toolchain-uclibc.inc
> +++ b/conf/distro/include/sane-toolchain-uclibc.inc
> @@ -23,12 +23,12 @@ PREFERRED_VERSION_uclibc-cross-intermediate ?= "${PREFERRED_UCLIBC_VERSION}"
>
>   #mess with compiler flags to use -Os instead of -O2
>   #Please see http://free-electrons.com/doc/embedded_linux_optimizations/img47.html for some more info
> -FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -Os -pipe"
> +FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -Os -pipe ${DEBUG_FLAGS}"
>   BUILD_OPTIMIZATION += "-pipe"
>
>   # -Os compiled root file system does not boot for powerpc, root cause it still at large
>   # we use -O2 meanwhile
> -FULL_OPTIMIZATION_powerpc = "-O2 -pipe"
> +FULL_OPTIMIZATION_powerpc = "-O2 -pipe ${DEBUG_FLAGS}"
>
>   #Gcc will die with 'internal consistency error when using the above optimizations
>   #with gcc-4.2.1-atmel.1.0.3 (and probably most other avr32 gcc ports).
> @@ -38,7 +38,7 @@ FULL_OPTIMIZATION_powerpc = "-O2 -pipe"
>   #it was removed while debugging an issue that ultimately turned out to be due
>   #to the ICE fixed by gcc-pr32889.patch.  It needs to be tested again.
>   #Note that this testing was done without the gcc-pr32889.patch.
> -FULL_OPTIMIZATION_avr32 = "-Os -fomit-frame-pointer"
> +FULL_OPTIMIZATION_avr32 = "-Os -fomit-frame-pointer ${DEBUG_FLAGS}"
>
>   TARGET_LINK_HASH_STYLE = "${@['-Wl,--hash-style=gnu',''][bb.data.getVar('TARGET_ARCH',d,1) in ['mips', 'mipsel', 'mips64', 'mips64el', 'avr32']]}"
>
> diff --git a/conf/distro/include/sane-toolchain-uclinux-uclibc.inc b/conf/distro/include/sane-toolchain-uclinux-uclibc.inc
> index a1e7df0..8ebaf15 100644
> --- a/conf/distro/include/sane-toolchain-uclinux-uclibc.inc
> +++ b/conf/distro/include/sane-toolchain-uclinux-uclibc.inc
> @@ -9,7 +9,7 @@ USE_NLS_gcc-cross = "no"
>
>   #mess with compiler flags to use -Os instead of -O2
>   #Please see http://free-electrons.com/doc/embedded_linux_optimizations/img47.html for some more info
> -FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -Os -pipe"
> +FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -Os -pipe ${DEBUG_FLAGS}"
>   BUILD_OPTIMIZATION = "-Os"
>
>   #Gcc will die with 'internal consistency error when using the above optimizations


-- 
Tom Rini
Mentor Graphics Corporation



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCHv2] sane-toolchain-*: define DEBUG_FLAGS and add it to FULL_OPTIMIZATION to make -dbg packages more usefull
  2011-03-02 19:55 ` [PATCHv2] sane-toolchain-*: define DEBUG_FLAGS and add it " Martin Jansa
  2011-03-02 22:29   ` Tom Rini
@ 2011-03-02 23:22   ` Khem Raj
  1 sibling, 0 replies; 16+ messages in thread
From: Khem Raj @ 2011-03-02 23:22 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Martin Jansa

On Wed, Mar 2, 2011 at 11:55 AM, Martin Jansa <martin.jansa@gmail.com> wrote:
> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>

Acked-by: Khem Raj <raj.khem@gmail.com>

> ---
>  conf/bitbake.conf                                  |    5 +++--
>  conf/distro/include/sane-toolchain-eglibc.inc      |   12 ++++++------
>  conf/distro/include/sane-toolchain-glibc.inc       |   10 +++++-----
>  conf/distro/include/sane-toolchain-uclibc.inc      |    6 +++---
>  .../include/sane-toolchain-uclinux-uclibc.inc      |    2 +-
>  5 files changed, 18 insertions(+), 17 deletions(-)
>
> diff --git a/conf/bitbake.conf b/conf/bitbake.conf
> index 0c11cdb..f23dd05 100644
> --- a/conf/bitbake.conf
> +++ b/conf/bitbake.conf
> @@ -543,10 +543,11 @@ EXTRA_OEMAKE_prepend_task-compile = "${PARALLEL_MAKE} "
>  # Optimization flags.
>  ##################################################################
>
> +DEBUG_FLAGS = "-g"
>  FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2"
> -DEBUG_OPTIMIZATION = "-O -fno-omit-frame-pointer -g"
> +DEBUG_OPTIMIZATION = "-O -fno-omit-frame-pointer ${DEBUG_FLAGS}"
>  SELECTED_OPTIMIZATION = "${@bb.data.getVar(['FULL_OPTIMIZATION', 'DEBUG_OPTIMIZATION'][bb.data.getVar('DEBUG_BUILD', d, 1) == '1'], d, 1)}"
> -BUILD_OPTIMIZATION = "-O2 -g"
> +BUILD_OPTIMIZATION = "-O2 ${DEBUG_FLAGS}"
>
>  ##################################################################
>  # Bootstrap stuff.
> diff --git a/conf/distro/include/sane-toolchain-eglibc.inc b/conf/distro/include/sane-toolchain-eglibc.inc
> index daab0f8..d38ca5d 100644
> --- a/conf/distro/include/sane-toolchain-eglibc.inc
> +++ b/conf/distro/include/sane-toolchain-eglibc.inc
> @@ -3,20 +3,20 @@
>  # eglibc:
>  # [23:00] oxo: glibc (any version) on sparc does not like (repeat me) "-Os"
>
> -FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -Os"
> -FULL_OPTIMIZATION_pn-perl = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O1"
> -FULL_OPTIMIZATION_sparc = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2"
> +FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -Os ${DEBUG_FLAGS}"
> +FULL_OPTIMIZATION_pn-perl = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O1 ${DEBUG_FLAGS}"
> +FULL_OPTIMIZATION_sparc = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 ${DEBUG_FLAGS}"
>
>  # gcc 4.4 and 4.5 has a problem with 'leakage' into libgcc.a with -Os
> -FULL_OPTIMIZATION_powerpc = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2"
> +FULL_OPTIMIZATION_powerpc = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 ${DEBUG_FLAGS}"
>
>  # JaMa: I promise to report bug upstream, but as it can take a while to fix it, I'll switch to -O2 here
>  # Tested with gcc-4.4.2 and gcc-4.4.3 on armv4t and armv5te and it fails with -Os, with gcc-4.3.3 it works OK with -Os
>  # Here is testcase, but you have to rebuild whole libqtxml to test it
>  # http://lists.shr-project.org/pipermail/shr-devel/2010-February/002169.html
> -FULL_OPTIMIZATION_pn-qt4-x11-free = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2"
> +FULL_OPTIMIZATION_pn-qt4-x11-free = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 ${DEBUG_FLAGS}"
>  # This I've seen only on armv4t, it segfaults when called from pisi, but whole test unit suite can pass
> -FULL_OPTIMIZATION_pn-libsyncml = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2"
> +FULL_OPTIMIZATION_pn-libsyncml = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 ${DEBUG_FLAGS}"
>
>  BUILD_OPTIMIZATION_pn-perl = "-O1"
>  BUILD_OPTIMIZATION_sparc = "-O2"
> diff --git a/conf/distro/include/sane-toolchain-glibc.inc b/conf/distro/include/sane-toolchain-glibc.inc
> index 770aa87..29c201b 100644
> --- a/conf/distro/include/sane-toolchain-glibc.inc
> +++ b/conf/distro/include/sane-toolchain-glibc.inc
> @@ -7,14 +7,14 @@
>  # perl has some problems, see http://bugs.openembedded.net/show_bug.cgi?id=1616
>  # [23:00] oxo: glibc (any version) on sparc does not like (repeat me) "-Os"
>
> -FULL_OPTIMIZATION = "-fexpensive-optimizations -frename-registers -fomit-frame-pointer -O2"
> +FULL_OPTIMIZATION = "-fexpensive-optimizations -frename-registers -fomit-frame-pointer -O2 ${DEBUG_FLAGS}"
>
> -FULL_OPTIMIZATION_pn-perl = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O1"
> -FULL_OPTIMIZATION_pn-glibc = "-fexpensive-optimizations -fomit-frame-pointer -O2"
> -FULL_OPTIMIZATION_sparc = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2"
> +FULL_OPTIMIZATION_pn-perl = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O1 ${DEBUG_FLAGS}"
> +FULL_OPTIMIZATION_pn-glibc = "-fexpensive-optimizations -fomit-frame-pointer -O2 ${DEBUG_FLAGS}"
> +FULL_OPTIMIZATION_sparc = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 ${DEBUG_FLAGS}"
>
>  # gcc 4.4 and 4.5 has a problem with 'leakage' into libgcc.a with -Os
> -FULL_OPTIMIZATION_powerpc = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2"
> +FULL_OPTIMIZATION_powerpc = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 ${DEBUG_FLAGS}"
>
>  BUILD_OPTIMIZATION_pn-perl = "-O1"
>  BUILD_OPTIMIZATION_pn-glibc = "-O2"
> diff --git a/conf/distro/include/sane-toolchain-uclibc.inc b/conf/distro/include/sane-toolchain-uclibc.inc
> index b61ee36..b51cdaf 100644
> --- a/conf/distro/include/sane-toolchain-uclibc.inc
> +++ b/conf/distro/include/sane-toolchain-uclibc.inc
> @@ -23,12 +23,12 @@ PREFERRED_VERSION_uclibc-cross-intermediate ?= "${PREFERRED_UCLIBC_VERSION}"
>
>  #mess with compiler flags to use -Os instead of -O2
>  #Please see http://free-electrons.com/doc/embedded_linux_optimizations/img47.html for some more info
> -FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -Os -pipe"
> +FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -Os -pipe ${DEBUG_FLAGS}"
>  BUILD_OPTIMIZATION += "-pipe"
>
>  # -Os compiled root file system does not boot for powerpc, root cause it still at large
>  # we use -O2 meanwhile
> -FULL_OPTIMIZATION_powerpc = "-O2 -pipe"
> +FULL_OPTIMIZATION_powerpc = "-O2 -pipe ${DEBUG_FLAGS}"
>
>  #Gcc will die with 'internal consistency error when using the above optimizations
>  #with gcc-4.2.1-atmel.1.0.3 (and probably most other avr32 gcc ports).
> @@ -38,7 +38,7 @@ FULL_OPTIMIZATION_powerpc = "-O2 -pipe"
>  #it was removed while debugging an issue that ultimately turned out to be due
>  #to the ICE fixed by gcc-pr32889.patch.  It needs to be tested again.
>  #Note that this testing was done without the gcc-pr32889.patch.
> -FULL_OPTIMIZATION_avr32 = "-Os -fomit-frame-pointer"
> +FULL_OPTIMIZATION_avr32 = "-Os -fomit-frame-pointer ${DEBUG_FLAGS}"
>
>  TARGET_LINK_HASH_STYLE = "${@['-Wl,--hash-style=gnu',''][bb.data.getVar('TARGET_ARCH',d,1) in ['mips', 'mipsel', 'mips64', 'mips64el', 'avr32']]}"
>
> diff --git a/conf/distro/include/sane-toolchain-uclinux-uclibc.inc b/conf/distro/include/sane-toolchain-uclinux-uclibc.inc
> index a1e7df0..8ebaf15 100644
> --- a/conf/distro/include/sane-toolchain-uclinux-uclibc.inc
> +++ b/conf/distro/include/sane-toolchain-uclinux-uclibc.inc
> @@ -9,7 +9,7 @@ USE_NLS_gcc-cross = "no"
>
>  #mess with compiler flags to use -Os instead of -O2
>  #Please see http://free-electrons.com/doc/embedded_linux_optimizations/img47.html for some more info
> -FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -Os -pipe"
> +FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -Os -pipe ${DEBUG_FLAGS}"
>  BUILD_OPTIMIZATION = "-Os"
>
>  #Gcc will die with 'internal consistency error when using the above optimizations
> --
> 1.7.4.1
>
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
>



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2011-03-02 23:24 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-01  9:10 [PATCH] sane-toolchain-*: add -g to FULL_OPTIMIZATION to make -dbg packages more usefull Martin Jansa
2011-03-01 11:15 ` Otavio Salvador
2011-03-01 16:07 ` Tom Rini
2011-03-01 17:03   ` Otavio Salvador
2011-03-01 17:39     ` Tom Rini
2011-03-01 17:50       ` Otavio Salvador
2011-03-01 17:54         ` Tom Rini
2011-03-01 18:10           ` Phil Blundell
2011-03-01 18:29             ` Tom Rini
2011-03-01 19:14               ` Khem Raj
2011-03-01 19:33                 ` Tom Rini
2011-03-01 19:37                   ` Khem Raj
2011-03-01 20:17               ` Phil Blundell
2011-03-02 19:55 ` [PATCHv2] sane-toolchain-*: define DEBUG_FLAGS and add it " Martin Jansa
2011-03-02 22:29   ` Tom Rini
2011-03-02 23:22   ` Khem Raj

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.