This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

How to compile gcc with no optimization and "-gdwarf-2 -g3"


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]