building gcc

Paolo Bonzini paolo.bonzini@lu.unisi.ch
Thu Oct 12 08:12:00 GMT 2006


> In particular, I was just wondering how do compile GCC with debug. Not
> how to debug it. I tried CFLAGS="-g" ./configure ..., but it still
> compiled with gcc -O2 -g. Anyways, if anyone knows a helpful configure
> trick that will help get me ready to debug gcc, please let me know.

By default, GCC bootstraps itself, and after the first stage it always 
compiles itself with optimization enabled.  So what you need is

./configure --enable-languages=c,c++ --disable-bootstrap
make CFLAGS=-g

(or equivalently, with CFLAGS=-g passed to configure).

Paolo



More information about the Gcc mailing list