All of lore.kernel.org
 help / color / mirror / Atom feed
* [rfc] change default for BUILD_OPTIMIZATION, remove spurious assignments
@ 2009-06-12 19:55 Phil Blundell
  2009-06-12 20:24 ` Richard Purdie
  0 siblings, 1 reply; 10+ messages in thread
From: Phil Blundell @ 2009-06-12 19:55 UTC (permalink / raw)
  To: openembedded-devel

I'd like to propose changing the bitbake.conf default for
BUILD_OPTIMIZATION from "-O2" to "-O2 -g".  There seems no harm in
building debuggable binaries for host-side utilities and it makes life
somewhat easier when things go wrong.

Also, while investigating why assignments to this variable from
local.conf didn't do what I was expecting, I discovered that a whole lot
of files inside conf/, notably all of the sane-toolchain-*.inc files,
contain their own assignments to BUILD_OPTIMIZATION for no good reason
that I can see.  I would also propose to delete the assignments from
those files.  (There are a few other assignments in files that are
either DISTRO or MACHINE specific but I intend to leave those alone.)

p.





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

* Re: [rfc] change default for BUILD_OPTIMIZATION, remove spurious assignments
  2009-06-12 19:55 [rfc] change default for BUILD_OPTIMIZATION, remove spurious assignments Phil Blundell
@ 2009-06-12 20:24 ` Richard Purdie
  2009-06-12 20:41   ` Stefan Schmidt
  2009-06-18 18:09   ` Cliff Brake
  0 siblings, 2 replies; 10+ messages in thread
From: Richard Purdie @ 2009-06-12 20:24 UTC (permalink / raw)
  To: openembedded-devel

On Fri, 2009-06-12 at 20:55 +0100, Phil Blundell wrote:
> I'd like to propose changing the bitbake.conf default for
> BUILD_OPTIMIZATION from "-O2" to "-O2 -g".  There seems no harm in
> building debuggable binaries for host-side utilities and it makes life
> somewhat easier when things go wrong.
> 
> Also, while investigating why assignments to this variable from
> local.conf didn't do what I was expecting, I discovered that a whole lot
> of files inside conf/, notably all of the sane-toolchain-*.inc files,
> contain their own assignments to BUILD_OPTIMIZATION for no good reason
> that I can see.  I would also propose to delete the assignments from
> those files.  (There are a few other assignments in files that are
> either DISTRO or MACHINE specific but I intend to leave those alone.)

Acked-by: Richard Purdie <rpurdie@linux.intel.com>

Poky actually uses -ggdb now which makes the -dbg packages useful (if
huge).

Cheers,

Richard




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

* Re: [rfc] change default for BUILD_OPTIMIZATION, remove spurious assignments
  2009-06-12 20:24 ` Richard Purdie
@ 2009-06-12 20:41   ` Stefan Schmidt
  2009-06-18 18:09   ` Cliff Brake
  1 sibling, 0 replies; 10+ messages in thread
From: Stefan Schmidt @ 2009-06-12 20:41 UTC (permalink / raw)
  To: openembedded-devel

Hello.

On Fri, 2009-06-12 at 21:24, Richard Purdie wrote:
> On Fri, 2009-06-12 at 20:55 +0100, Phil Blundell wrote:
> > I'd like to propose changing the bitbake.conf default for
> > BUILD_OPTIMIZATION from "-O2" to "-O2 -g".  There seems no harm in
> > building debuggable binaries for host-side utilities and it makes life
> > somewhat easier when things go wrong.
> > 
> > Also, while investigating why assignments to this variable from
> > local.conf didn't do what I was expecting, I discovered that a whole lot
> > of files inside conf/, notably all of the sane-toolchain-*.inc files,
> > contain their own assignments to BUILD_OPTIMIZATION for no good reason
> > that I can see.  I would also propose to delete the assignments from
> > those files.  (There are a few other assignments in files that are
> > either DISTRO or MACHINE specific but I intend to leave those alone.)
> 
> Acked-by: Richard Purdie <rpurdie@linux.intel.com>
> 
> Poky actually uses -ggdb now which makes the -dbg packages useful (if
> huge).

Perhaps go directly for -ggdb3? (There is always magic to learn if you hack some
time with zecke. :))

regards
Stefan Schmidt



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

* Re: [rfc] change default for BUILD_OPTIMIZATION, remove spurious  assignments
  2009-06-12 20:24 ` Richard Purdie
  2009-06-12 20:41   ` Stefan Schmidt
@ 2009-06-18 18:09   ` Cliff Brake
  2009-06-18 18:33     ` Phil Blundell
  2009-06-23 17:30     ` Khem Raj
  1 sibling, 2 replies; 10+ messages in thread
From: Cliff Brake @ 2009-06-18 18:09 UTC (permalink / raw)
  To: openembedded-devel; +Cc: openembedded-devel

On Fri, Jun 12, 2009 at 4:24 PM, Richard Purdie<rpurdie@rpsys.net> wrote:
> On Fri, 2009-06-12 at 20:55 +0100, Phil Blundell wrote:
>> I'd like to propose changing the bitbake.conf default for
>> BUILD_OPTIMIZATION from "-O2" to "-O2 -g".  There seems no harm in
>> building debuggable binaries for host-side utilities and it makes life
>> somewhat easier when things go wrong.
>>
>> Also, while investigating why assignments to this variable from
>> local.conf didn't do what I was expecting, I discovered that a whole lot
>> of files inside conf/, notably all of the sane-toolchain-*.inc files,
>> contain their own assignments to BUILD_OPTIMIZATION for no good reason
>> that I can see.  I would also propose to delete the assignments from
>> those files.  (There are a few other assignments in files that are
>> either DISTRO or MACHINE specific but I intend to leave those alone.)
>
> Acked-by: Richard Purdie <rpurdie@linux.intel.com>
>
> Poky actually uses -ggdb now which makes the -dbg packages useful (if
> huge).

Poky currently uses:
##################################################################
# Optimization flags.
##################################################################

FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer
-frename-registers -O2 -ggdb -feliminate-unused-debug-types"
DEBUG_OPTIMIZATION = "-O -fno-omit-frame-pointer -g"
SELECTED_OPTIMIZATION = "${@bb.data.getVar(['FULL_OPTIMIZATION',
'DEBUG_OPTIMIZATION'][bb.data.getVar('DEBUG_BUILD', d, 1) == '1'], d,
1)}"
BUILD_OPTIMIZATION = "-O2"

OE uses:
##################################################################
# Optimization flags.
##################################################################

FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer
-frename-registers -O2"
DEBUG_OPTIMIZATION = "-O -fno-omit-frame-pointer -g"
SELECTED_OPTIMIZATION = "${@bb.data.getVar(['FULL_OPTIMIZATION',
'DEBUG_OPTIMIZATION'][bb.data.getVar('DEBUG_BUILD', d, 1) == '1'], d,
1)}"
BUILD_OPTIMIZATION = "-O2 -g"

I agree, debug symbols are nice in *dbg packages.  Are there any other
thoughts pro/con for changing OE to match Poky FULL_OPTIMIZATION
settings?

As to -ggdb3, the following information may be helpful.

-ggdblevel

           Request debugging information and also use level to specify
how much information.  The default level is 2.

           Level 0 produces no debug information at all.  Thus, -g0 negates -g.

           Level 1 produces minimal information, enough for making
backtraces in parts of the program that you don’t plan to debug.
           This includes descriptions of functions and external
variables, but no information about local variables and no line
numbers.

           Level 3 includes extra information, such as all the macro
definitions present in the program.  Some debuggers support macro
           expansion when you use -g3.

So maybe a good way to do this is:
FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer
-frename-registers -O2 -ggdb -feliminate-unused-debug-types"
DEBUG_OPTIMIZATION = "-O -fno-omit-frame-pointer -ggdb3"
BUILD_OPTIMIZATION = "-O2 -ggdb"

That way with *dbg packages installed, you could at least get a back
trace with a normal build.  If you needed line numbers, you could set
DEBUG_BUILD and rebuild packages of interest.

Any thoughts on -g vs -ggdb for BUILD_OPTIMIZATION?

Thanks,
Cliff



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

* Re: [rfc] change default for BUILD_OPTIMIZATION, remove spurious  assignments
  2009-06-18 18:09   ` Cliff Brake
@ 2009-06-18 18:33     ` Phil Blundell
  2009-06-23 17:30     ` Khem Raj
  1 sibling, 0 replies; 10+ messages in thread
From: Phil Blundell @ 2009-06-18 18:33 UTC (permalink / raw)
  To: openembedded-devel

On Thu, 2009-06-18 at 14:09 -0400, Cliff Brake wrote:
> I agree, debug symbols are nice in *dbg packages.  Are there any other
> thoughts pro/con for changing OE to match Poky FULL_OPTIMIZATION
> settings?

The Poky setting does look better.  I can't see any harm in changing OE
to match that.

> Any thoughts on -g vs -ggdb for BUILD_OPTIMIZATION?

Looking at what gcc actually does with those options, it doesn't seem
like there's much difference for the common targets that we support.  So
I don't really have a view on it either way.

p.





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

* Re: [rfc] change default for BUILD_OPTIMIZATION, remove spurious  assignments
  2009-06-18 18:09   ` Cliff Brake
  2009-06-18 18:33     ` Phil Blundell
@ 2009-06-23 17:30     ` Khem Raj
  2009-06-23 17:46       ` Phil Blundell
  1 sibling, 1 reply; 10+ messages in thread
From: Khem Raj @ 2009-06-23 17:30 UTC (permalink / raw)
  To: openembedded-devel; +Cc: openembedded-devel

On Thu, Jun 18, 2009 at 11:09 AM, Cliff Brake<cliff.brake@gmail.com> wrote:
> On Fri, Jun 12, 2009 at 4:24 PM, Richard Purdie<rpurdie@rpsys.net> wrote:
>> On Fri, 2009-06-12 at 20:55 +0100, Phil Blundell wrote:
>>> I'd like to propose changing the bitbake.conf default for
>>> BUILD_OPTIMIZATION from "-O2" to "-O2 -g".  There seems no harm in
>>> building debuggable binaries for host-side utilities and it makes life
>>> somewhat easier when things go wrong.
>>>
>>> Also, while investigating why assignments to this variable from
>>> local.conf didn't do what I was expecting, I discovered that a whole lot
>>> of files inside conf/, notably all of the sane-toolchain-*.inc files,
>>> contain their own assignments to BUILD_OPTIMIZATION for no good reason
>>> that I can see.  I would also propose to delete the assignments from
>>> those files.  (There are a few other assignments in files that are
>>> either DISTRO or MACHINE specific but I intend to leave those alone.)
>>
>> Acked-by: Richard Purdie <rpurdie@linux.intel.com>
>>
>> Poky actually uses -ggdb now which makes the -dbg packages useful (if
>> huge).
>
> Poky currently uses:
> ##################################################################
> # Optimization flags.
> ##################################################################
>
> FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer
> -frename-registers -O2 -ggdb -feliminate-unused-debug-types"
> DEBUG_OPTIMIZATION = "-O -fno-omit-frame-pointer -g"
> SELECTED_OPTIMIZATION = "${@bb.data.getVar(['FULL_OPTIMIZATION',
> 'DEBUG_OPTIMIZATION'][bb.data.getVar('DEBUG_BUILD', d, 1) == '1'], d,
> 1)}"
> BUILD_OPTIMIZATION = "-O2"
>
> OE uses:
> ##################################################################
> # Optimization flags.
> ##################################################################
>
> FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer
> -frename-registers -O2"
> DEBUG_OPTIMIZATION = "-O -fno-omit-frame-pointer -g"
> SELECTED_OPTIMIZATION = "${@bb.data.getVar(['FULL_OPTIMIZATION',
> 'DEBUG_OPTIMIZATION'][bb.data.getVar('DEBUG_BUILD', d, 1) == '1'], d,
> 1)}"
> BUILD_OPTIMIZATION = "-O2 -g"
>
> I agree, debug symbols are nice in *dbg packages.  Are there any other
> thoughts pro/con for changing OE to match Poky FULL_OPTIMIZATION
> settings?
>
> As to -ggdb3, the following information may be helpful.
>
> -ggdblevel
>
>           Request debugging information and also use level to specify
> how much information.  The default level is 2.
>
>           Level 0 produces no debug information at all.  Thus, -g0 negates -g.
>
>           Level 1 produces minimal information, enough for making
> backtraces in parts of the program that you don’t plan to debug.
>           This includes descriptions of functions and external
> variables, but no information about local variables and no line
> numbers.
>
>           Level 3 includes extra information, such as all the macro
> definitions present in the program.  Some debuggers support macro
>           expansion when you use -g3.
>
> So maybe a good way to do this is:
> FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer
> -frename-registers -O2 -ggdb -feliminate-unused-debug-types"

-feliminate-unused-debug-types should only affect stabs which I guess we
do not use. We could use -feliminate-dwarf2-dups if we are using dwarf2
 -frename-registers was a workaround to get past a ARM GCC ICE in 4.2 IIRC
we should get rid of it.

-fexpensive-optimizations and -fomit-frame-pointer are passed by
default at O2 so we should get rid of them too.

Should we also use something SIZE_OPTIMIZATION combination ?

> DEBUG_OPTIMIZATION = "-O -fno-omit-frame-pointer -ggdb3"
> BUILD_OPTIMIZATION = "-O2 -ggdb"
>
> That way with *dbg packages installed, you could at least get a back
> trace with a normal build.  If you needed line numbers, you could set
> DEBUG_BUILD and rebuild packages of interest.
>
> Any thoughts on -g vs -ggdb for BUILD_OPTIMIZATION?
>
> Thanks,
> Cliff
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
>



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

* Re: [rfc] change default for BUILD_OPTIMIZATION, remove spurious  assignments
  2009-06-23 17:30     ` Khem Raj
@ 2009-06-23 17:46       ` Phil Blundell
  2009-06-23 18:09         ` Tom Rini
                           ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Phil Blundell @ 2009-06-23 17:46 UTC (permalink / raw)
  To: openembedded-devel

On Tue, 2009-06-23 at 10:30 -0700, Khem Raj wrote:
>  -frename-registers was a workaround to get past a ARM GCC ICE in 4.2 IIRC
> we should get rid of it.

No, -frename-registers is an optimisation in its own right.  I think we
probably want to keep that.  You might be thinking of the
-fno-rename-registers that we do use for some packages to avoid an ice
on arm with gcc 3.4.

> -fexpensive-optimizations and -fomit-frame-pointer are passed by
> default at O2 so we should get rid of them too.

Is that true on all targets?  I didn't think that -O2 implied
-fomit-frame-pointer on arm.

p.





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

* Re: [rfc] change default for BUILD_OPTIMIZATION, remove spurious assignments
  2009-06-23 17:46       ` Phil Blundell
@ 2009-06-23 18:09         ` Tom Rini
  2009-06-23 19:15         ` Khem Raj
  2009-09-10  7:00         ` Holger Hans Peter Freyther
  2 siblings, 0 replies; 10+ messages in thread
From: Tom Rini @ 2009-06-23 18:09 UTC (permalink / raw)
  To: openembedded-devel

On Tue, Jun 23, 2009 at 06:46:54PM +0100, Phil Blundell wrote:
> On Tue, 2009-06-23 at 10:30 -0700, Khem Raj wrote:
> >  -frename-registers was a workaround to get past a ARM GCC ICE in 4.2 IIRC
> > we should get rid of it.
> 
> No, -frename-registers is an optimisation in its own right.  I think we
> probably want to keep that.  You might be thinking of the
> -fno-rename-registers that we do use for some packages to avoid an ice
> on arm with gcc 3.4.
> 
> > -fexpensive-optimizations and -fomit-frame-pointer are passed by
> > default at O2 so we should get rid of them too.
> 
> Is that true on all targets?  I didn't think that -O2 implied
> -fomit-frame-pointer on arm.

The 4.2.4 manual says:
"`-O' also turns on `-fomit-frame-pointer' on machines where doing so
does not interfere with debugging."  Which means that yes, iirc ARM
won't have that turned on.

-- 
Tom Rini



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

* Re: [rfc] change default for BUILD_OPTIMIZATION, remove spurious  assignments
  2009-06-23 17:46       ` Phil Blundell
  2009-06-23 18:09         ` Tom Rini
@ 2009-06-23 19:15         ` Khem Raj
  2009-09-10  7:00         ` Holger Hans Peter Freyther
  2 siblings, 0 replies; 10+ messages in thread
From: Khem Raj @ 2009-06-23 19:15 UTC (permalink / raw)
  To: openembedded-devel

On Tue, Jun 23, 2009 at 10:46 AM, Phil Blundell<philb@gnu.org> wrote:
> On Tue, 2009-06-23 at 10:30 -0700, Khem Raj wrote:
>>  -frename-registers was a workaround to get past a ARM GCC ICE in 4.2 IIRC
>> we should get rid of it.
>
> No, -frename-registers is an optimisation in its own right.

yes I was mentioning about why we have it enabled.

I think we
> probably want to keep that.

side effect is that It hampers debugging

 You might be thinking of the
> -fno-rename-registers that we do use for some packages to avoid an ice
> on arm with gcc 3.4.

yeah thats right. Rusted me

>
>> -fexpensive-optimizations and -fomit-frame-pointer are passed by
>> default at O2 so we should get rid of them too.
>
> Is that true on all targets?

yes

I didn't think that -O2 implied
> -fomit-frame-pointer on arm.
>
> p.
>
>
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
>



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

* Re: [rfc] change default for BUILD_OPTIMIZATION, remove spurious  assignments
  2009-06-23 17:46       ` Phil Blundell
  2009-06-23 18:09         ` Tom Rini
  2009-06-23 19:15         ` Khem Raj
@ 2009-09-10  7:00         ` Holger Hans Peter Freyther
  2 siblings, 0 replies; 10+ messages in thread
From: Holger Hans Peter Freyther @ 2009-09-10  7:00 UTC (permalink / raw)
  To: openembedded-devel

On Tuesday 23 June 2009 19:46:54 Phil Blundell wrote:
> On Tue, 2009-06-23 at 10:30 -0700, Khem Raj wrote:
> >  -frename-registers was a workaround to get past a ARM GCC ICE in 4.2
> > IIRC we should get rid of it.
>
> No, -frename-registers is an optimisation in its own right.  I think we
> probably want to keep that.  You might be thinking of the
> -fno-rename-registers that we do use for some packages to avoid an ice
> on arm with gcc 3.4.
>
> > -fexpensive-optimizations and -fomit-frame-pointer are passed by
> > default at O2 so we should get rid of them too.
>
> Is that true on all targets?  I didn't think that -O2 implied
> -fomit-frame-pointer on arm.

From my  testing on recent gcc... it is turned on by default.

z.



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

end of thread, other threads:[~2009-09-10  7:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-12 19:55 [rfc] change default for BUILD_OPTIMIZATION, remove spurious assignments Phil Blundell
2009-06-12 20:24 ` Richard Purdie
2009-06-12 20:41   ` Stefan Schmidt
2009-06-18 18:09   ` Cliff Brake
2009-06-18 18:33     ` Phil Blundell
2009-06-23 17:30     ` Khem Raj
2009-06-23 17:46       ` Phil Blundell
2009-06-23 18:09         ` Tom Rini
2009-06-23 19:15         ` Khem Raj
2009-09-10  7:00         ` Holger Hans Peter Freyther

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.