public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* [Newb] Building with debug info and no optimization
@ 2004-03-20  4:11 sashan
  2004-03-20  4:29 ` Ian Lance Taylor
  2004-03-30  1:16 ` Jim Wilson
  0 siblings, 2 replies; 5+ messages in thread
From: sashan @ 2004-03-20  4:11 UTC (permalink / raw)
  To: gcc

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



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Newb] Building with debug info and no optimization
  2004-03-20  4:11 [Newb] Building with debug info and no optimization sashan
@ 2004-03-20  4:29 ` Ian Lance Taylor
  2004-03-30  1:16 ` Jim Wilson
  1 sibling, 0 replies; 5+ messages in thread
From: Ian Lance Taylor @ 2004-03-20  4:29 UTC (permalink / raw)
  To: sashan; +Cc: gcc

sashan <sashang@ihug.co.nz> writes:

> 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

There is probably some way to make that approach work.  However, the
easy way is to not set CFLAGS in the environment at all, and instead
do
    make CFLAGS=-g

Ian

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Newb] Building with debug info and no optimization
  2004-03-20  4:11 [Newb] Building with debug info and no optimization sashan
  2004-03-20  4:29 ` Ian Lance Taylor
@ 2004-03-30  1:16 ` Jim Wilson
  2004-03-30  5:48   ` Mike Stump
  1 sibling, 1 reply; 5+ messages in thread
From: Jim Wilson @ 2004-03-30  1:16 UTC (permalink / raw)
  To: sashan; +Cc: gcc

sashan wrote:
> 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

If you look at the errors carefully, you will see that the problem is 
not in the toplevel but rather in one of the subdirectories.  So the 
problem is not ./config.cache but rather subdir/config.cache, where you 
can get subdir from the make output.  You can try deleting them one at a 
time, but if one is broken probably all are broken.  So you may want to 
try something like "rm */config.cache".

It is probably safer to just configure a new tree though.  Delete the 
old build tree and configure a new one, instead of trying to reconfigure 
a build tree after a cvs update.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Newb] Building with debug info and no optimization
  2004-03-30  1:16 ` Jim Wilson
@ 2004-03-30  5:48   ` Mike Stump
  2004-03-30 17:36     ` Andreas Schwab
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Stump @ 2004-03-30  5:48 UTC (permalink / raw)
  To: Jim Wilson; +Cc: sashan, gcc

On Monday, March 29, 2004, at 04:11 PM, Jim Wilson wrote:
> sashan wrote:
>> 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
>
> If you look at the errors carefully, you will see that the problem is 
> not in the toplevel but rather in one of the subdirectories.  So the 
> problem is not ./config.cache but rather subdir/config.cache, where 
> you can get subdir from the make output.  You can try deleting them 
> one at a time, but if one is broken probably all are broken.  So you 
> may want to try something like "rm */config.cache".
>
> It is probably safer to just configure a new tree though.  Delete the 
> old build tree and configure a new one, instead of trying to 
> reconfigure a build tree after a cvs update.

I think I hate the new code.  :-(  The times this kicks out errors from 
make; cvs update make; cvs update; make; cvs update is just annoying.  
In my experience, rm */config.cache; make restores the reliability of 
the operation.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Newb] Building with debug info and no optimization
  2004-03-30  5:48   ` Mike Stump
@ 2004-03-30 17:36     ` Andreas Schwab
  0 siblings, 0 replies; 5+ messages in thread
From: Andreas Schwab @ 2004-03-30 17:36 UTC (permalink / raw)
  To: Mike Stump; +Cc: Jim Wilson, sashan, gcc

Mike Stump <mrs@apple.com> writes:

> I think I hate the new code.  :-(  The times this kicks out errors from
> make; cvs update make; cvs update; make; cvs update is just annoying.  In
> my experience, rm */config.cache; make restores the reliability of the
> operation.

I think the problem is that configure-foo exports a different set of
envvars than all-foo.  You can remove the sub makefiles to force rerunning
configure-foo from the toplevel.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-03-30  9:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-20  4:11 [Newb] Building with debug info and no optimization sashan
2004-03-20  4:29 ` Ian Lance Taylor
2004-03-30  1:16 ` Jim Wilson
2004-03-30  5:48   ` Mike Stump
2004-03-30 17:36     ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).