Skip to contentSkip to conversation

sane-toolchain-*: add -g to FULL_OPTIMIZATION to make -dbg packages more usefull

PATCH Superseded Martin Jansa 5 participants 16 messages Mar 1, 2011 – Mar 2, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sane-toolchain-*: add -g to FULL_OPTIMIZATION to make -dbg packages more usefull

---
 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(-)
conf/distro/include/sane-toolchain-eglibc.inc +6 -6
index daab0f8..e22976f 100644
@@ -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"
conf/distro/include/sane-toolchain-glibc.inc +5 -5
index 770aa87..09b88b6 100644
@@ -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"
conf/distro/include/sane-toolchain-uclibc.inc +3 -3
index b61ee36..acb843c 100644
@@ -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']]}"
 
conf/distro/include/sane-toolchain-uclinux-uclibc.inc +1 -1
index a1e7df0..9490084 100644
@@ -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
Signature · 1 line
1.7.4.1
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Martin Jansa

---

 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(-)
Signature · 3 lines
Otavio Salvador                             O.S. Systems
E-mail: [email protected]  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
#2 lore raw
In reply to Martin Jansa
Quoted 7 lines · Martin Jansa
---
  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).

Signature · 2 lines
Tom Rini
Mentor Graphics Corporation
#3 lore raw
Quoted 1 line · Tom Rini

On 03/01/2011 02:10 AM, Martin Jansa wrote:

...

Quoted 3 lines

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?

Signature · 3 lines
Otavio Salvador                             O.S. Systems
E-mail: [email protected]  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
#4 lore raw
Quoted 9 lines · Otavio Salvador
Quoted 1 line · Tom Rini

On 03/01/2011 02:10 AM, Martin Jansa wrote:

...

Quoted 3 lines

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.

Signature · 2 lines
Tom Rini
Mentor Graphics Corporation
#5 lore raw
Quoted 8 lines · Tom Rini
Quoted 2 lines · Otavio Salvador

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?

Signature · 3 lines
Otavio Salvador                             O.S. Systems
E-mail: [email protected]  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
#6 lore raw
Quoted 11 lines · Otavio Salvador
Quoted 8 lines · Tom Rini
Quoted 2 lines · Otavio Salvador

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).

Signature · 2 lines
Tom Rini
Mentor Graphics Corporation
#7 lore raw
Quoted 3 lines · Tom Rini

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.

#8 lore raw
Quoted 9 lines · Phil Blundell
Quoted 3 lines · Tom Rini

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.

Signature · 2 lines
Tom Rini
Mentor Graphics Corporation
#9 lore raw
Quoted 13 lines · Tom Rini
Quoted 11 lines · Phil Blundell
Quoted 4 lines · Tom Rini

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.

Quoted 5 lines

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

Quoted 9 lines

--
Tom Rini
Mentor Graphics Corporation

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

#10 lore raw
Quoted 14 lines · Khem Raj
Quoted 13 lines · Tom Rini
Quoted 11 lines · Phil Blundell
Quoted 4 lines · Tom Rini

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.

Quoted 8 lines
Quoted 5 lines

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.

Signature · 2 lines
Tom Rini
Mentor Graphics Corporation
#11 lore raw
Quoted 25 lines · Tom Rini
Quoted 24 lines · Khem Raj
Quoted 21 lines · Tom Rini
Quoted 11 lines · Phil Blundell
Quoted 4 lines · Tom Rini

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.

Quoted 5 lines
Quoted 2 lines

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

Quoted 5 lines

--
Tom Rini
Mentor Graphics Corporation

#12 lore raw
In reply to Tom Rini
Quoted 4 lines · Tom Rini

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.

#13 lore raw

PATCH v2 1/1 sane-toolchain-*: define DEBUG_FLAGS and add it to FULL_OPTIMIZATION to make -dbg packages more usefull

In reply to Martin Jansa
---
 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(-)
conf/bitbake.conf +3 -2
index 0c11cdb..f23dd05 100644
@@ -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.
conf/distro/include/sane-toolchain-eglibc.inc +6 -6
index daab0f8..d38ca5d 100644
@@ -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"
conf/distro/include/sane-toolchain-glibc.inc +5 -5
index 770aa87..29c201b 100644
@@ -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"
conf/distro/include/sane-toolchain-uclibc.inc +3 -3
index b61ee36..b51cdaf 100644
@@ -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']]}"
 
conf/distro/include/sane-toolchain-uclinux-uclibc.inc +1 -1
index a1e7df0..8ebaf15 100644
@@ -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
Signature · 1 line
1.7.4.1
Acked-by on v2 1/1
#14 lore raw

Re: [PATCHv2] sane-toolchain-*: define DEBUG_FLAGS and add it to FULL_OPTIMIZATION to make -dbg packages more usefull

Quoted 1 line · Martin Jansa
Quoted 122 lines
---
  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(-)
conf/bitbake.conf +3 -2
index 0c11cdb..f23dd05 100644
@@ -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.
conf/distro/include/sane-toolchain-eglibc.inc +6 -6
index daab0f8..d38ca5d 100644
@@ -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"
conf/distro/include/sane-toolchain-glibc.inc +5 -5
index 770aa87..29c201b 100644
@@ -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"
conf/distro/include/sane-toolchain-uclibc.inc +3 -3
index b61ee36..b51cdaf 100644
@@ -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']]}"
 
conf/distro/include/sane-toolchain-uclinux-uclibc.inc +1 -1
index a1e7df0..8ebaf15 100644
@@ -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
Signature · 2 lines
Tom Rini
Mentor Graphics Corporation
Acked-by on v2 1/1
#15 lore raw

Re: [PATCHv2] sane-toolchain-*: define DEBUG_FLAGS and add it to FULL_OPTIMIZATION to make -dbg packages more usefull

In reply to Martin Jansa
Quoted 1 line · Martin Jansa
Quoted 131 lines

---
 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(-)
conf/bitbake.conf +1 -0
index 0c11cdb..f23dd05 100644
@@ -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"

conf/bitbake.conf +1 -1
-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)}"

conf/bitbake.conf +1 -1
-BUILD_OPTIMIZATION = "-O2 -g"
+BUILD_OPTIMIZATION = "-O2 ${DEBUG_FLAGS}"

 ##################################################################
 # Bootstrap stuff.

conf/distro/include/sane-toolchain-eglibc.inc +6 -6
index daab0f8..d38ca5d 100644
@@ -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"

conf/distro/include/sane-toolchain-glibc.inc +5 -5
index 770aa87..29c201b 100644
@@ -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"

conf/distro/include/sane-toolchain-uclibc.inc +1 -1
index b61ee36..b51cdaf 100644
@@ -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
conf/distro/include/sane-toolchain-uclibc.inc +1 -1
-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).

conf/distro/include/sane-toolchain-uclibc.inc +1 -1
@@ -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']]}"

conf/distro/include/sane-toolchain-uclinux-uclibc.inc +1 -1
index a1e7df0..8ebaf15 100644
@@ -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
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel