[libstdc++] Make use of runtime demangler

Franz Sirl Franz.Sirl-kernel@lauterbach.com
Thu Apr 25 13:17:00 GMT 2002


On Monday 01 April 2002 19:12, Mark Mitchell wrote:
> --On Friday, March 29, 2002 06:29:24 PM -0500 Phil Edwards <phil@jaj.com>
>
> wrote:
> > This builds the new __cxa_demangle'r into the C++ support library.
> >
> > We link to cp-demangle.c and dyn-string.c, then compile them locally into
> > v3. Two important notes:
> >
> > 1) Those two files do not build warning-free because in the v3 build,
> >    -DHAVE_CONFIG_H is not passed (thus the headers for malloc and whatnot
> >    are not included) because we can't give it the config.h from
> > libiberty. I played with building a symlink to libiberty's config.h but I
> > don't know the multilibs scenario well enough.  Help is requested.  For
> > now, we pass -Wno-error in the special build rules.
>
> I believe we need to fix this, or risk problems on platforms where ints
> and pointers do not have the same size.

Oops, nearly forgot about this one, I have a patch for this. It's actually a 
bug in the libstdc++ Makefiles, cause configure generates config.h for 
libstdc++ too. In trying to pass the DEBUG_FLAGS on the right place in the 
compile command, $(DEFS) got left out.

I chose a not so error-prone setup in using $(COMPILE) and $(CXXCOMPILE) and 
explicitly adding @DEBUG_FLAGS@ instead of the handcrufted stuff.

Bootstrapped/regtested on powerpc-linux-gnu and x86-linux-gnu.

Ah, this doesn't cure the warnings for the string functions yet, cause 
configure doesn't check for string.h and I wasn't sure where to add it.

Franz.


	* libsupc++/Makefile.am (LTCOMPILE): Use $(COMPILE).
	(LTCXXCOMPILE): Use $(CXXCOMPILE).
	* src/Makefile.am (LTCXXCOMPILE): Use $(CXXCOMPILE).
	* libsupc++/Makefile.in: Regenerate.
	* src/Makefile.in: Regenerate.


-------------- next part --------------
Index: libstdc++-v3/libsupc++/Makefile.am
===================================================================
RCS file: /cvsroot/gcc/gcc/libstdc++-v3/libsupc++/Makefile.am,v
retrieving revision 1.29.8.1
diff -u -p -r1.29.8.1 Makefile.am
--- libstdc++-v3/libsupc++/Makefile.am	1 Apr 2002 22:09:28 -0000	1.29.8.1
+++ libstdc++-v3/libsupc++/Makefile.am	25 Apr 2002 20:06:22 -0000
@@ -118,8 +118,7 @@ dyn-string.o: dyn-string.c
 
 # LTCOMPILE is copied from LTCXXCOMPILE below.
 LTCOMPILE = $(LIBTOOL) --tag CC --tag disable-shared \
-               --mode=compile $(CC) $(INCLUDES) \
-               $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS) 
+               --mode=compile $(COMPILE) @DEBUG_FLAGS@
 
 
 # AM_CXXFLAGS needs to be in each subdirectory so that it can be
@@ -136,7 +135,7 @@ AM_CXXFLAGS = \
 
 # libstdc++ libtool notes
 
-# 1) Need to explicitly set LTCXXCOMPILE so that AM_CXXFLAGS is
+# 1) Need to explicitly set LTCXXCOMPILE so that DEBUG_FLAGS is
 # last. (That way, things like -O2 passed down from the toplevel can
 # be overridden by --enable-debug.)
 
@@ -156,8 +155,7 @@ AM_CXXFLAGS = \
 # We have to put --tag disable-shared after --tag CXX lest things
 # CXX undo the affect of disable-shared.
 LTCXXCOMPILE = $(LIBTOOL) --tag CXX --tag disable-shared \
-               --mode=compile $(CXX) $(INCLUDES) \
-	       $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS) 
+               --mode=compile $(CXXCOMPILE) @DEBUG_FLAGS@
 
 # 3) We'd have a problem when building the shared libstdc++ object if
 # the rules automake generates would be used.  We cannot allow g++ to
Index: libstdc++-v3/src/Makefile.am
===================================================================
RCS file: /cvsroot/gcc/gcc/libstdc++-v3/src/Makefile.am,v
retrieving revision 1.103.2.2
diff -u -p -r1.103.2.2 Makefile.am
--- libstdc++-v3/src/Makefile.am	25 Mar 2002 21:02:24 -0000	1.103.2.2
+++ libstdc++-v3/src/Makefile.am	25 Apr 2002 20:06:22 -0000
@@ -122,7 +122,7 @@ AM_CXXFLAGS = \
 
 # libstdc++ libtool notes
 
-# 1) Need to explicitly set LTCXXCOMPILE so that AM_CXXFLAGS is
+# 1) Need to explicitly set LTCXXCOMPILE so that DEBUG_FLAGS is
 # last. (That way, things like -O2 passed down from the toplevel can
 # be overridden by --enable-debug.)
 
@@ -138,8 +138,7 @@ AM_CXXFLAGS = \
 # correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe
 # CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to
 # attempt to infer which configuration to use
-LTCXXCOMPILE = $(LIBTOOL) --tag CXX --mode=compile $(CXX) $(INCLUDES) \
-	       $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS) 
+LTCXXCOMPILE = $(LIBTOOL) --tag CXX --mode=compile $(CXXCOMPILE) @DEBUG_FLAGS@
 
 # 3) We'd have a problem when building the shared libstdc++ object if
 # the rules automake generates would be used.  We cannot allow g++ to


More information about the Libstdc++ mailing list