libgcc c++ support bits moved

Richard Henderson rth@cygnus.com
Mon Oct 9 14:20:00 GMT 2000


All the C++ support bits have now been moved out of libgcc.

In the case of libstdc++-v2, I've just included the necessary files
directly into libstdc++.{a,so}.

In the case of libstdc++-v3, it's a bit more complicated.  The support
_is_ included in libstdc++.{a,so}, so in what I'd consider the normal
case, the user need do nothing new.  But by request from the c++ team,
there is also a new libsupc++ library that just contains the language
support routines.  We do _not_ build a shared version of this library,
since we expect this to be used primarily by embedded developers.

The removal of the C++ bits from libgcc also allows some of the build
infrastructure to be simplified a smidgin.

Tested on alpha-linux.


r~


gcc/
        * Makefile.in (LANG_LIB2FUNCS): Remove.
        (LIB2FUNCS): Remove _pure.
        (LIB2ADD): Remove LANG_LIB2FUNCS.
        (stage_a): Don't set LANG_LIB2FUNCS.
        * libgcc2.c (__terminate): Mark noreturn.
        (__pure_virtual): Remove.
        * mklibgcc.in: Remove LIB2ADD .txt processing.

gcc/cp/
        * Make-lang.in (CXX_EXTRA_HEADERS): Remove.
        (c++ language support bits for libgcc): Remove.
        (c++.clean): Remove cplib2.txt cleanup.
        * config-lang.in (headers, lib2funcs): Remove.

        * exception.cc, new.cc, new1.cc, new2.cc: Remove files.
        * tinfo.cc, tinfo.h, tinfo2.cc, vec.cc: Remove files.
        * inc/cxxabi.h, inc/exception, inc/new: Remove files.
        * inc/new.h, inc/typeinfo: Remove files.

Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/egcs/gcc/Makefile.in,v
retrieving revision 1.521
diff -c -p -d -r1.521 Makefile.in
*** Makefile.in	2000/10/08 23:20:17	1.521
--- Makefile.in	2000/10/09 21:05:53
*************** INCLUDES = -I. -I$(srcdir) -I$(srcdir)/c
*** 630,636 ****
  LANG_MAKEFILES = @all_lang_makefiles@
  LANG_STAGESTUFF = @all_stagestuff@
  LANG_DIFF_EXCLUDES = @all_diff_excludes@
- LANG_LIB2FUNCS = @all_lib2funcs@
  LANG_EXTRA_HEADERS = @all_headers@
  
  # Flags to pass to recursive makes.
--- 630,635 ----
*************** LIB2FUNCS = _muldi3 _divdi3 _moddi3 _udi
*** 755,761 ****
      _fixtfdi _fixunstfdi _floatditf \
      __gcc_bcmp _varargs __dummy _eprintf \
      _bb _shtab _clear_cache _trampoline __main _exit \
!     _ctors _pure
  
  LIB2FUNCS_EH = _eh
  
--- 754,760 ----
      _fixtfdi _fixunstfdi _floatditf \
      __gcc_bcmp _varargs __dummy _eprintf \
      _bb _shtab _clear_cache _trampoline __main _exit \
!     _ctors
  
  LIB2FUNCS_EH = _eh
  
*************** xlimits.h: glimits.h limitx.h limity.h
*** 961,967 ****
  #
  # Build libgcc.a.
  
! LIB2ADD = $(LIB2ADDEH) $(LIB2FUNCS_EXTRA) $(LANG_LIB2FUNCS)
  
  libgcc.mk: config.status Makefile mklibgcc $(LIB2ADD) xgcc$(exeext)
  	objext='$(objext)' \
--- 960,966 ----
  #
  # Build libgcc.a.
  
! LIB2ADD = $(LIB2ADDEH) $(LIB2FUNCS_EXTRA)
  
  libgcc.mk: config.status Makefile mklibgcc $(LIB2ADD) xgcc$(exeext)
  	objext='$(objext)' \
*************** VOL_FILES=`echo $(BACKEND) $(OBJS) $(C_O
*** 2788,2794 ****
  # we can guarantee will build with the native compiler, and also it is the
  # only thing useful for building stage2.
  stage_a: 
! 	+$(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES="$(BOOT_LANGUAGES)" LANG_LIB2FUNCS=
  	touch stage_a
  
  stage_b: stage_a
--- 2787,2793 ----
  # we can guarantee will build with the native compiler, and also it is the
  # only thing useful for building stage2.
  stage_a: 
! 	+$(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES="$(BOOT_LANGUAGES)"
  	touch stage_a
  
  stage_b: stage_a
Index: libgcc2.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/libgcc2.c,v
retrieving revision 1.100
diff -c -p -d -r1.100 libgcc2.c
*** libgcc2.c	2000/10/06 05:29:56	1.100
--- libgcc2.c	2000/10/09 21:05:53
*************** __default_terminate (void)
*** 2990,2996 ****
  void (*__terminate_func)(void) __attribute__ ((__noreturn__)) =
    __default_terminate;
  
! void
  __terminate (void)
  {
    (*__terminate_func)();
--- 2990,2996 ----
  void (*__terminate_func)(void) __attribute__ ((__noreturn__)) =
    __default_terminate;
  
! void __attribute__((__noreturn__))
  __terminate (void)
  {
    (*__terminate_func)();
*************** __throw ()
*** 4181,4208 ****
  #endif /* IA64_UNWIND_INFO  */
  
  #endif /* L_eh */
- 
- #ifdef L_pure
- #ifndef inhibit_libc
- /* This gets us __GNU_LIBRARY__.  */
- #undef NULL /* Avoid errors if stdio.h and our stddef.h mismatch.  */
- #include <stdio.h>
- 
- #ifdef __GNU_LIBRARY__
-   /* Avoid forcing the library's meaning of `write' on the user program
-      by using the "internal" name (for use within the library)  */
- #define write(fd, buf, n)	__write((fd), (buf), (n))
- #endif
- #endif /* inhibit_libc */
- 
- #define MESSAGE "pure virtual method called\n"
- 
- void
- __pure_virtual (void)
- {
- #ifndef inhibit_libc
-   write (2, MESSAGE, sizeof (MESSAGE) - 1);
- #endif
-   __terminate ();
- }
- #endif
--- 4181,4183 ----
Index: mklibgcc.in
===================================================================
RCS file: /cvs/gcc/egcs/gcc/mklibgcc.in,v
retrieving revision 1.19
diff -c -p -d -r1.19 mklibgcc.in
*** mklibgcc.in	2000/10/08 23:20:18	1.19
--- mklibgcc.in	2000/10/09 21:05:53
*************** for file in $LIB2ADD; do
*** 225,268 ****
    name=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//' -e 's/[.]txt$//'`
    oname=`echo $name | sed -e 's,.*/,,'`
  
!   if [ ${name}.txt = ${file} ]; then
!     fprime=`cat $file`
!     for f in $fprime; do
! 
!       lastout="stmp-dirs $file"
!       for ml in $MULTILIBS; do
!         dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
!         flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
!         out="libgcc/${dir}/${f}"
! 
! 	# Depend on previous out to serialize all sub-makes of this
! 	# target file.  This because ./$f is used as a temporary in
! 	# each case before being moved to libgcc/$dir/.
! 	echo $out: $lastout
! 	echo "	$make_compile" \\
! 	echo '	  LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)' $flags '" ' \\
! 	echo '	  MULTILIB_CFLAGS="'$flags'"' $f
! 	echo "	mv $f $out"
! 
! 	lastout="$out"
!       done
! 
!       libgcc2_objs="$libgcc2_objs $f"
!     done
!   else
!     for ml in $MULTILIBS; do
!       dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
!       flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
!       out="libgcc/${dir}/${oname}${objext}"
!       if [ ${name}.asm = ${file} ]; then
! 	flags="$flags -xassembler-with-cpp"
!       fi
  
!       echo $out: stmp-dirs $file
!       echo "	$gcc_compile" $flags -c $file -o $out
!     done
!     libgcc2_objs="$libgcc2_objs ${oname}${objext}"
!   fi
  done
  
  # SHLIB_MKMAP
--- 225,242 ----
    name=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//' -e 's/[.]txt$//'`
    oname=`echo $name | sed -e 's,.*/,,'`
  
!   for ml in $MULTILIBS; do
!     dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
!     flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
!     out="libgcc/${dir}/${oname}${objext}"
!     if [ ${name}.asm = ${file} ]; then
!       flags="$flags -xassembler-with-cpp"
!     fi
  
!     echo $out: stmp-dirs $file
!     echo "	$gcc_compile" $flags -c $file -o $out
!   done
!   libgcc2_objs="$libgcc2_objs ${oname}${objext}"
  done
  
  # SHLIB_MKMAP
Index: cp/Make-lang.in
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/Make-lang.in,v
retrieving revision 1.61
diff -c -p -d -r1.61 Make-lang.in
*** Make-lang.in	2000/09/14 16:49:11	1.61
--- Make-lang.in	2000/10/09 21:05:53
*************** DEMANGLER_CROSS_NAME = `t='$(program_tra
*** 56,65 ****
  # The name to use for the demangler program.
  DEMANGLER_PROG = c++filt$(exeext)
  
- # Extra headers to install.
- CXX_EXTRA_HEADERS = $(srcdir)/cp/inc/typeinfo $(srcdir)/cp/inc/exception \
- 	$(srcdir)/cp/inc/new $(srcdir)/cp/inc/new.h $(srcdir)/cp/inc/cxxabi.h
- 
  # Extra code to include in libgcc2.
  CXX_LIB2FUNCS = tinfo.o tinfo2.o new.o opnew.o opnewnt.o opvnew.o opvnewnt.o \
  	opdel.o opdelnt.o opvdel.o opvdelnt.o exception.o vec.o
--- 56,61 ----
*************** c++.rest.encap: $(DEMANGLER_PROG)
*** 137,195 ****
  
  c++.info:
  c++.dvi:
- 
- # C++ language-support library pieces for libgcc.
- tinfo.o: cc1plus$(exeext) $(srcdir)/cp/tinfo.cc
- 	$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(GXX_ABI_FLAG) $(CXXFLAGS) $(INCLUDES) \
- 	  -c $(srcdir)/cp/tinfo.cc
- tinfo2.o: cc1plus$(exeext) $(srcdir)/cp/tinfo2.cc
- 	$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(GXX_ABI_FLAG) $(CXXFLAGS) $(INCLUDES) \
- 	  -c $(srcdir)/cp/tinfo2.cc
- exception.o: cc1plus$(exeext) $(srcdir)/cp/exception.cc
- 	$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(GXX_ABI_FLAG) $(CXXFLAGS) $(INCLUDES) \
- 	  -c -fexceptions $(srcdir)/cp/exception.cc
- new.o: cc1plus$(exeext) $(srcdir)/cp/new.cc
- 	$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(GXX_ABI_FLAG) $(CXXFLAGS) $(INCLUDES) \
- 	  -c $(srcdir)/cp/new.cc
- opnew.o: cc1plus$(exeext) $(srcdir)/cp/new1.cc
- 	$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(GXX_ABI_FLAG) $(CXXFLAGS) $(INCLUDES) \
- 	  -c $(srcdir)/cp/new1.cc -DL_op_new -o opnew.o
- opnewnt.o: cc1plus$(exeext) $(srcdir)/cp/new1.cc
- 	$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(GXX_ABI_FLAG) $(CXXFLAGS) $(INCLUDES) \
- 	  -c $(srcdir)/cp/new1.cc -DL_op_newnt -o opnewnt.o
- opvnew.o: cc1plus$(exeext) $(srcdir)/cp/new2.cc
- 	$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(GXX_ABI_FLAG) $(CXXFLAGS) $(INCLUDES) \
- 	  -c $(srcdir)/cp/new2.cc -DL_op_vnew -o opvnew.o
- opvnewnt.o: cc1plus$(exeext) $(srcdir)/cp/new2.cc
- 	$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(GXX_ABI_FLAG) $(CXXFLAGS) $(INCLUDES) \
- 	  -c $(srcdir)/cp/new2.cc -DL_op_vnewnt -o opvnewnt.o
- opdel.o: cc1plus$(exeext) $(srcdir)/cp/new2.cc
- 	$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(GXX_ABI_FLAG) $(CXXFLAGS) $(INCLUDES) \
- 	  -c $(srcdir)/cp/new2.cc -DL_op_delete -o opdel.o
- opdelnt.o: cc1plus$(exeext) $(srcdir)/cp/new2.cc
- 	$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(GXX_ABI_FLAG) $(CXXFLAGS) $(INCLUDES) \
- 	  -c $(srcdir)/cp/new2.cc -DL_op_delnt -o opdelnt.o
- opvdel.o: cc1plus$(exeext) $(srcdir)/cp/new2.cc
- 	$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(GXX_ABI_FLAG) $(CXXFLAGS) $(INCLUDES) \
- 	  -c $(srcdir)/cp/new2.cc -DL_op_vdel -o opvdel.o
- opvdelnt.o: cc1plus$(exeext) $(srcdir)/cp/new2.cc
- 	$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(GXX_ABI_FLAG) $(CXXFLAGS) $(INCLUDES) \
- 	  -c $(srcdir)/cp/new2.cc -DL_op_vdelnt -o opvdelnt.o
- vec.o: cc1plus$(exeext) $(srcdir)/cp/vec.cc
- 	$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(GXX_ABI_FLAG) $(CXXFLAGS) $(INCLUDES) \
- 	  -c $(srcdir)/cp/vec.cc -o vec.o
- 
- # We want to update cplib2.txt if any of the source files change or if the
- # Makefile (which contains the list of sources) changes.
- cplib2.txt: $(CXX_LIB2SRCS) $(CXX_EXTRA_HEADERS) cp/Makefile
- 	case " $(LANGUAGES) " in \
- 	*" "[cC]"++ "*) \
- 	  echo $(CXX_LIB2FUNCS) > cplib2.new;; \
- 	*) \
- 	  echo "" > cplib2.new;; \
- 	esac
- 	mv -f cplib2.new cplib2.txt 
- 
  #
  # Install hooks:
  # cc1plus is installed elsewhere as part of $(COMPILERS).
--- 133,138 ----
*************** c++.uninstall:
*** 269,275 ****
  c++.mostlyclean:
  	-rm -f cp/*$(objext) $(DEMANGLER_PROG)
  c++.clean:
- 	-rm -f cplib2.txt
  c++.distclean:
  	-rm -f cp/config.status cp/Makefile
  	-rm -f cp/parse.output
--- 212,217 ----
Index: cp/config-lang.in
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/config-lang.in,v
retrieving revision 1.5
diff -c -p -d -r1.5 config-lang.in
*** config-lang.in	1999/01/06 20:57:30	1.5
--- config-lang.in	2000/10/09 21:05:53
*************** stagestuff="g++\$(exeext) g++-cross\$(ex
*** 34,41 ****
  
  diff_excludes="-x parse.c -x parse.h"
  
- headers='$(CXX_EXTRA_HEADERS)'
- 
- lib2funcs=cplib2.txt
- 
  outputs=cp/Makefile
--- 34,37 ----


More information about the Gcc-patches mailing list