public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Debugging flags
@ 1998-06-24 17:23 Daniel Egger
  1998-06-25  9:19 ` Manfred Hollstein
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Egger @ 1998-06-24 17:23 UTC (permalink / raw)
  To: egcs

Hiho!

 I don't know exactly how but my defined CFLAGS are overridden by
 the made Makefiles in gcc and subdirs. Behause of the inheritance of
 variables that are defined in Makefiles it should be enough to define
 them in the topdir of the tree but they are defined in every single subdir.

 Further we have a nice autoconfig screict which figures out what
 options to use to compile the whole thing. But they will be only used
 if we substitute all CFLAGS and CXXFLAGS with @CFLAGS@ and
 @CXXFLAGS@. This will also allow to remove the whole debugging
 thing simply by a added option to the autoconf script which will follow
 in the next days. 
 But first here's the patch to remove hardcoded CFLAGS:

 *** libstdc++/Makefile.in.temp	Wed Jun 24 14:24:17 1998
--- libstdc++/Makefile.in	Wed Jun 24 14:24:57 1998
***************
*** 54,61 ****
  CLEAN_JUNK = $(LIBS)
  
  # Remove these for public releases.
! CXXFLAGS = -g -O -Wpointer-arith -Wnested-externs -Woverloaded-virtual -Wbad-function-cast -Winline -Wwrite-strings -Weffc++
! CFLAGS = -g -O -Wpointer-arith -Wnested-externs
  
  .PHONY: libs
  libs: $(LIBS)
--- 54,61 ----
  CLEAN_JUNK = $(LIBS)
  
  # Remove these for public releases.
! CXXFLAGS = @CXXFLAGS@ -Wpointer-arith -Wnested-externs -Woverloaded-virtual -Wbad-function-cast -Winline -Wwrite-strings -Weffc++
! CFLAGS = @CFLAGS@ -Wpointer-arith -Wnested-externs
  
  .PHONY: libs
  libs: $(LIBS)
*** gcc/Makefile.in.temp	Wed Jun 24 14:27:01 1998
--- gcc/Makefile.in	Wed Jun 24 14:29:43 1998
***************
*** 61,67 ****
  # TCFLAGS is used for compilations with the GCC just built.
  XCFLAGS =
  TCFLAGS =
! CFLAGS = -g
  BOOT_CFLAGS = -O2 $(CFLAGS)
  WARN_CFLAGS = -W -Wall
  # These exists to be overridden by the x-* and t-* files, respectively.
--- 61,67 ----
  # TCFLAGS is used for compilations with the GCC just built.
  XCFLAGS =
  TCFLAGS =
! CFLAGS = @CFLAGS@
  BOOT_CFLAGS = -O2 $(CFLAGS)
  WARN_CFLAGS = -W -Wall
  # These exists to be overridden by the x-* and t-* files, respectively.
*** gcc/cp/Makefile.in.temp	Wed Jun 24 14:33:11 1998
--- gcc/cp/Makefile.in	Wed Jun 24 14:33:24 1998
***************
*** 45,51 ****
  # to the stage2 and stage3 compilations
  # XCFLAGS is used for most compilations but not when using the GCC just built.
  XCFLAGS =
! CFLAGS = -g
  BOOT_CFLAGS = -O $(CFLAGS)
  # These exists to be overridden by the x-* and t-* files, respectively.
  X_CFLAGS =
--- 45,51 ----
  # to the stage2 and stage3 compilations
  # XCFLAGS is used for most compilations but not when using the GCC just built.
  XCFLAGS =
! CFLAGS = @CFLAGS@
  BOOT_CFLAGS = -O $(CFLAGS)
  # These exists to be overridden by the x-* and t-* files, respectively.
  X_CFLAGS =
*** libio/dbz/Makefile.in.temp	Sat Sep 27 04:06:59 1997
--- libio/dbz/Makefile.in	Wed Jun 24 14:37:02 1998
***************
*** 1,5 ****
  srcdir = .
! CFLAGS = -g
  C_FLAGS = $(CFLAGS) -I$(srcdir) -I.. -I$(srcdir)/.. -DDBZ_FINISH='_IO_flush_all()'
  CC = `if [ -f ../../../gcc/gcc ] ; \
  	then echo ../../../gcc/gcc -B../../../gcc/ ; \
--- 1,5 ----
  srcdir = .
! CFLAGS = @CFLAGS@
  C_FLAGS = $(CFLAGS) -I$(srcdir) -I.. -I$(srcdir)/.. -DDBZ_FINISH='_IO_flush_all()'
  CC = `if [ -f ../../../gcc/gcc ] ; \
  	then echo ../../../gcc/gcc -B../../../gcc/ ; \
*** libio/testsuite/Makefile.in.temp	Tue Aug 26 18:28:23 1997
--- libio/testsuite/Makefile.in	Wed Jun 24 14:38:42 1998
***************
*** 17,25 ****
  
  srcdir = libio.tests
  
! CFLAGS = -g
  C_FLAGS = $(CFLAGS) -I. -I.. -I$(srcdir) -I$(srcdir)/..
! CXXFLAGS = -g
  CC = gcc
  CXX = gcc
  
--- 17,25 ----
  
  srcdir = libio.tests
  
! CFLAGS = @CFLAGS@
  C_FLAGS = $(CFLAGS) -I. -I.. -I$(srcdir) -I$(srcdir)/..
! CXXFLAGS = @CXXFLAGS@
  CC = gcc
  CXX = gcc
  
*** Makefile.in.temp	Mon Jun 22 21:22:02 1998
--- Makefile.in	Wed Jun 24 14:40:04 1998
***************
*** 70,77 ****
  HOST_PREFIX_1 = loser-
  
  # These flag values are normally overridden by the configure script.
! CFLAGS = -g
! CXXFLAGS = -g -O2
  
  LIBCFLAGS = $(CFLAGS)
  CFLAGS_FOR_TARGET = $(CFLAGS)
--- 70,77 ----
  HOST_PREFIX_1 = loser-
  
  # These flag values are normally overridden by the configure script.
! CFLAGS = @CFLAGS@
! CXXFLAGS = @CXXFLAGS@
  
  LIBCFLAGS = $(CFLAGS)
  CFLAGS_FOR_TARGET = $(CFLAGS)
 


--

Servus,
       Daniel

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

* Re: Debugging flags
  1998-06-24 17:23 Debugging flags Daniel Egger
@ 1998-06-25  9:19 ` Manfred Hollstein
  1998-06-25 12:07   ` Joe Buck
  1998-06-26 13:32   ` Daniel Egger
  0 siblings, 2 replies; 7+ messages in thread
From: Manfred Hollstein @ 1998-06-25  9:19 UTC (permalink / raw)
  To: Daniel.Egger; +Cc: egcs

On Wed, 24 June 1998, 16:17:17, Daniel.Egger@t-online.de wrote:

 > Hiho!
 > 
 >  I don't know exactly how but my defined CFLAGS are overridden by
 >  the made Makefiles in gcc and subdirs. Behause of the inheritance of
 >  variables that are defined in Makefiles it should be enough to define
 >  them in the topdir of the tree but they are defined in every single subdir.

But, it doesn't  hurt, as they are  passed down via FLAGS_TO_PASS. You
could even re-define CFLAGS/CXXFLAGS on the "make ..." command line.

 > 
 >  Further we have a nice autoconfig screict which figures out what
 >  options to use to compile the whole thing. But they will be only used
 >  if we substitute all CFLAGS and CXXFLAGS with @CFLAGS@ and
 >  @CXXFLAGS@. This will also allow to remove the whole debugging
 >  thing simply by a added option to the autoconf script which will follow
 >  in the next days. 

This is not true.  If you actually  look at the configure machinery (I
admit  it's  quite complicated  ;-), you'll   see that the "hardcoded"
*FLAGS will  be substituted using  sed by whatever you've defined when
calling configure.

If your  only intention is to avoid  `-g' in CFLAGS and  probably want
stripped executables by default, simply do it this way:

$ env CC="{your_preferred_C_compiler}" CFLAGS="-O2" LDFLAGS=-s \
  ${path_to_egcs_directory}/configure ...

and then simply call:

$ make bootstrap; make check; make install

It's  really that simple.  And, don't omit  `-g' from CXXFLAGS as this
will prevent you   from being able   to  use your   favourite debugger
looking at  C++ objects whose type definitions  originate from  one of
those C++ libs.

 >  But first here's the patch to remove hardcoded CFLAGS:
 > 
 [patch removed as it is not necessary]

manfred

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

* Re: Debugging flags
  1998-06-25  9:19 ` Manfred Hollstein
@ 1998-06-25 12:07   ` Joe Buck
  1998-06-26 13:32   ` Daniel Egger
  1 sibling, 0 replies; 7+ messages in thread
From: Joe Buck @ 1998-06-25 12:07 UTC (permalink / raw)
  To: manfred, Manfred.Hollstein; +Cc: Daniel.Egger, egcs

> It's  really that simple.  And, don't omit  `-g' from CXXFLAGS as this
> will prevent you   from being able   to  use your   favourite debugger
> looking at  C++ objects whose type definitions  originate from  one of
> those C++ libs.

It's been suggested that `-g1' could be used here, to generate partial
(but enough) debugging information in the C++ objects.  I have not
verified this.

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

* Re: Debugging flags
  1998-06-25  9:19 ` Manfred Hollstein
  1998-06-25 12:07   ` Joe Buck
@ 1998-06-26 13:32   ` Daniel Egger
  1998-06-26 22:48     ` Mumit Khan
  1998-06-27  7:22     ` Manfred Hollstein
  1 sibling, 2 replies; 7+ messages in thread
From: Daniel Egger @ 1998-06-26 13:32 UTC (permalink / raw)
  To: Manfred Hollstein; +Cc: egcs

On Thu, 25 Jun 1998, Manfred Hollstein wrote:

>$ env CC="{your_preferred_C_compiler}" CFLAGS="-O2" LDFLAGS=-s \
>  ${path_to_egcs_directory}/configure ...

>and then simply call:

>$ make bootstrap; make check; make install

 Guess what.... it won't work the way you believe it to do ... why? Because
 there are hardcoded -g's which  won't get substituted. I'm trying to make
 the whole process more consistent. That means we should use the same
 mechanisms all over the tree. At the moment it's a whole chaos....

>It's  really that simple.  And, don't omit  `-g' from CXXFLAGS as this
>will prevent you   from being able   to  use your   favourite debugger
>looking at  C++ objects whose type definitions  originate from  one of
>those C++ libs.

 I seldom use debuggers to debug egcs. And if I intend to do so I'll compile
 it completely with debugging. For normal programs I don't need a debugable
 libstdc++.....

> [patch removed as it is not necessary]

 It may be not necessary but it would clarify things,,,,

--

Servus,
       Daniel

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

* Re: Debugging flags
  1998-06-26 13:32   ` Daniel Egger
@ 1998-06-26 22:48     ` Mumit Khan
  1998-06-27  7:22     ` Manfred Hollstein
  1 sibling, 0 replies; 7+ messages in thread
From: Mumit Khan @ 1998-06-26 22:48 UTC (permalink / raw)
  To: Daniel.Egger; +Cc: egcs

Daniel.Egger@t-online.de (Daniel Egger) writes:
> 
>  I seldom use debuggers to debug egcs. And if I intend to do so I'll compile
>  it completely with debugging. For normal programs I don't need a debugable
>  libstdc++.....
> 

Actually, you do if you build egcs with --enable-shared. It's rather
messy to debug C++ "user programs" when a shared libstdc++ is compiled
without -g, with or without -O/-O2.

Mumit

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

* Re: Debugging flags
  1998-06-26 13:32   ` Daniel Egger
  1998-06-26 22:48     ` Mumit Khan
@ 1998-06-27  7:22     ` Manfred Hollstein
  1998-06-28 12:37       ` Daniel Egger
  1 sibling, 1 reply; 7+ messages in thread
From: Manfred Hollstein @ 1998-06-27  7:22 UTC (permalink / raw)
  To: Daniel.Egger; +Cc: egcs

On Fri, 26 June 1998, 15:57:24, Daniel.Egger@t-online.de wrote:

 > On Thu, 25 Jun 1998, Manfred Hollstein wrote:
 > 
 > >$ env CC="{your_preferred_C_compiler}" CFLAGS="-O2" LDFLAGS=-s \
 > >  ${path_to_egcs_directory}/configure ...
 > 
 > >and then simply call:
 > 
 > >$ make bootstrap; make check; make install
 > 
 >  Guess what.... it won't work the way you believe it to do ... why? Because

Sure it does work! Have you actually looked at the generated toplevel Makefile's
CFLAGS/CXXFLAGS? They contain what you've been using at configure time and, since
they are passed down via BASE_FLAGS_TO_PASS, each submake will use them, although
their Makefile might contain different flags.

 >  there are hardcoded -g's which  won't get substituted. I'm trying to make
 >  the whole process more consistent. That means we should use the same
 >  mechanisms all over the tree. At the moment it's a whole chaos....

Not, if you were working as suggested above.

 > 
 > >It's  really that simple.  And, don't omit  `-g' from CXXFLAGS as this
 > >will prevent you   from being able   to  use your   favourite debugger
 > >looking at  C++ objects whose type definitions  originate from  one of
 > >those C++ libs.
 > 
 >  I seldom use debuggers to debug egcs. And if I intend to do so I'll compile
 >  it completely with debugging. For normal programs I don't need a debugable
 >  libstdc++.....
 > 
 > > [patch removed as it is not necessary]
 > 
 >  It may be not necessary but it would clarify things,,,,
 > 
 > --
 > 
 > Servus,
 >        Daniel
 > 

manfred

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

* Re: Debugging flags
  1998-06-27  7:22     ` Manfred Hollstein
@ 1998-06-28 12:37       ` Daniel Egger
  0 siblings, 0 replies; 7+ messages in thread
From: Daniel Egger @ 1998-06-28 12:37 UTC (permalink / raw)
  To: Manfred Hollstein; +Cc: egcs

On Sat, 27 Jun 1998, Manfred Hollstein wrote:

>each submake will
>use them, although\r their Makefile might contain different flags.

 That's the point. And I'm working to having the same flags in the whole
 process.... I just wonder why nobody had compiling problems due
 to this behaviour....

>Not, if you were working as suggested above.

 I think the ideal behaviour is the possibility to control everything by the
 configure script. Which isn't possbily right now. At the moment you
 have to export variables and hope that this will do the trick and no hardcoded
 flags are in your way. I still get those annoying -g's in bootstrapping process
 even if I set CFLAGS/CXXFLAGS accordingly. Not every user who's
 trying a official release of egcs knows how to override configure setting and
 won't know how to use a debugger either. So it's just rational to have
 a --disable-debug option to configure which will save lots of space and
 time without much fiddlings...

--

Servus,
       Daniel

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

end of thread, other threads:[~1998-06-28 12:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-06-24 17:23 Debugging flags Daniel Egger
1998-06-25  9:19 ` Manfred Hollstein
1998-06-25 12:07   ` Joe Buck
1998-06-26 13:32   ` Daniel Egger
1998-06-26 22:48     ` Mumit Khan
1998-06-27  7:22     ` Manfred Hollstein
1998-06-28 12:37       ` Daniel Egger

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).