Re: Why do we include debug symbols in !maintainer_mode?

2011-04-14 Thread Peter Samuelson

[Hyrum K Wright]
> Although I don't know if this has any impact on the processor
> i-cache, I still don't see much reason for using '-g -O2' in
> non-maintainer mode.

As others have said, no, it should have no effect on the icache, at
least on systems I know (mainly ELF).  The debug section isn't even
loaded into memory at runtime, it's just sitting there eating disk
until someone like gdb comes along and reads it explicitly.

With my Linux distribution packager hat on, though, I wouldn't mind if
the default were changed.  I'd change it back so I could provide
out-of-band debug symbols in my packages, but overriding CFLAGS at
build time is so trivial that anyone doing any special handling like
this shouldn't really be inconvenienced.
-- 
Peter Samuelson | org-tld!p12n!peter | http://p12n.org/


Re: Why do we include debug symbols in !maintainer_mode?

2011-04-14 Thread Philip Martin
Philip Martin  writes:

> Hyrum K Wright  writes:
>
>> Although I don't know if this has any impact on the processor
>> i-cache

On a Linux system the debug symbols are in separate ELF sections, the
loader probaby doesn't even map them into memory.

-- 
Philip


Re: Why do we include debug symbols in !maintainer_mode?

2011-04-14 Thread Greg Hudson
On Thu, 2011-04-14 at 14:25 -0400, Philip Martin wrote:
> I believe it is a GNU standard.  Debug symbols can be used with an
> optimised build although it is obviously easier to debug without
> optimisation

More specifically: stepping through a -g -O2 executable is pretty
painful, but you can still usually get a decent stack trace from one.




Re: Why do we include debug symbols in !maintainer_mode?

2011-04-14 Thread Philip Martin
Hyrum K Wright  writes:

> I just built a version of trunk to use on my "production" working
> copies, and configured it without maintainer mode.  I noticed that it
> was using '-g -O2' in the CFLAGS, which seems completely nonsensical:
> debug symbols often refer to stuff that gets optimized away, and just
> bloats the final executable.  Although I don't know if this has any
> impact on the processor i-cache, I still don't see much reason for
> using '-g -O2' in non-maintainer mode.
>
> Some voice in the back of my head says we've had this discussion
> before, but I can't seem to find it.  I just wanted to check here
> before I went and changed things.  (And for the record, I hacked my
> local Makefile to remove '-g' from CFLAGS.)

I believe it is a GNU standard.  Debug symbols can be used with an
optimised build although it is obviously easier to debug without
optimisation

Most distributions strip debug symbols from their binary packages
automatically.  These days GDB supports debug symbols in files separate
from the executables, so some distributions have started shipping debug
packages that contain the debug symbols for the stripped binaries.

-- 
Philip


Why do we include debug symbols in !maintainer_mode?

2011-04-14 Thread Hyrum K Wright
I just built a version of trunk to use on my "production" working
copies, and configured it without maintainer mode.  I noticed that it
was using '-g -O2' in the CFLAGS, which seems completely nonsensical:
debug symbols often refer to stuff that gets optimized away, and just
bloats the final executable.  Although I don't know if this has any
impact on the processor i-cache, I still don't see much reason for
using '-g -O2' in non-maintainer mode.

Some voice in the back of my head says we've had this discussion
before, but I can't seem to find it.  I just wanted to check here
before I went and changed things.  (And for the record, I hacked my
local Makefile to remove '-g' from CFLAGS.)

-Hyrum