[Newb] Building with debug info and no optimization

sashan sashang@ihug.co.nz
Sat Mar 20 04:11:00 GMT 2004


Hi

I'm trying to build gcc with debug info only so I do this at the command 
prompt

export CFLAGS=-g

I re-run configure to build the make file:
gcc_current_build $ ../gcc_current/configure --program-suffix=-current
gcc_current_build $ make

but it gives the following error and recommends running 'make distclean' 
and deleting the config.cache file

configure: error: `CFLAGS' has changed since the previous run:
configure:   former value:  -g -O2
configure:   current value: -g
configure: error: changes in the environment can compromise the build
configure: error: run `make distclean' and/or `rm ./config.cache' and 
start over

gcc_current_build $ make distclean

So I do this (it deletes config.cache) and rerun configure and then make 
but the same error occurs.

So how do I tell make that I want the CFLAG to be -g? I've tried it with 
maintainer-mode enabled but it still optimizes it (-O2).

gcc_current_build $ ../gcc_current/configure --enable-maintainer-mode --program-suffix=current --enable-languages=c,c++

I basically just want to run a simple program through gcc and gdb so that I can see how it puts stuff together (like how it reads the file, divides it into tokens, builds RTL etc..) and I don't want optimizations to get in the way because they can cause gdb to skip lines (I think).

Thanks

-- 
sashan
http://www.cs.auckland.ac.nz/~sgov008





More information about the Gcc mailing list