This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Disabling debug when building gcc
- From: Jeffrey Walton <noloader at gmail dot com>
- To: lol37 lol37 <lol37cs16 at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Mon, 25 Jul 2011 11:37:59 -0400
- Subject: Re: Disabling debug when building gcc
- References: <CAG0GeRBwx+VrRw4gBPHbk_zxGwW58XWMyw03Migj23M-G36HOw@mail.gmail.com>
- Reply-to: noloader at gmail dot com
On Mon, Jul 25, 2011 at 4:08 AM, lol37 lol37 <lol37cs16@gmail.com> 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