This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
How to compile gcc with no optimization and "-gdwarf-2 -g3"
- From: Liu Haibin <liu dot haibin at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Fri, 17 Jun 2005 20:10:46 +0800
- Subject: How to compile gcc with no optimization and "-gdwarf-2 -g3"
- Reply-to: Liu Haibin <liu dot haibin at gmail dot com>
Hi,
I want to build the whole gcc with "-gdwarf-2 -g3" and without any
optimization, so that I can debug gcc and see all the macros. I'm not
familiar with configure and make, so I tried to change all the CFLAGS
and others flags to "-gdwarf-2 -g3" in all the related files
(configure, configure.in, Makefile, Makefile.in, and Makefile.tpl). I
even changed the src/gcc/configure, src/gcc/Makefile.in and other
files. Basically, as long as I see something like "-g -O2", I change
it to "-gdwarf-2 -g3". And I configure it with
# ./configure --with-dwarf2
# make
But when it's compiling, I still see the -O2 optimization. And I tried
# ./configure --with-dwarf2
# make CFLAGS='-gdwarf-2 -g3' LIBCFLAGS='-gdwarf-2 -g3'
BOOT_CFLAGS='-gdwarf-2 -g3'
It's still the same. I can see the -O2 optimization. When I debug cc1,
I cannot see the macros. (I applied the patch to gdb so that it is
able to see macros)
How should I do to compile gcc with no optimization and "-gdwarf-2 -g3"?
Thanks.
Regards,
Timothy