Re: Disabling debug when building gcc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 25, 2011 at 4:08 AM, lol37 lol37 <lol37cs16@xxxxxxxxx> wrote:
> Hello all,
> How to disable completely -g flag when building gcc, i passed
> CFLAGS="-O2" and edited Makefile but all subdirectory ( libgcc,
> libstdc++v3, libgomp ... ) still uses the -g flags and i cannot edit
> their Makefile, they are creating while building ( configure )
> Can someone help me, it will be grateful.
I'm not familiar with automake and friends, so I can't help you with
pulling flags out.

According to the GCC folks, there is no penalty incurred with debug
symbols. See "How does the gcc -g option affect performance?",
http://gcc.gnu.org/ml/gcc-help/2005-03/msg00032.html.

You can remove symbols after the fact with `strip`:

  > ls -l myprogram
    ... 6866924 2009-04-28 16:12 myprogram
  > strip --strip-debug myprogram
  > ls -l myprogram
    ... 1738761 2009-04-28 16:13 myprogram

Jeff


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux