This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

C++ PATCH: Switch to the new ABI



[ NOTE: READ THIS IF YOU ARE A JAVA DEVELOPER ]

This patches switches us to the new C++ ABI by default on all
platforms.  

Java is now broken.  Java folks, you can use `--disable-new-gxx-abi'
to restore the old ABI.  Be aware, however, that the old ABI will rot,
and likely be removed, at some point in the not too distant future; it
will *not* be supported going forward.  Before doing anything which I
know will break the old ABI, I will tag the sources so that the Java
folks can work on a branch, if necessary.  However, I would recommend
that the Java team focus all short-term development efforts on
implementing the new ABI; that will reduce the long-term pain for all
concerned.

This was the last remaining major bit of functionality for GCC 3.0;
from now on, we will be focusing on compile-time performance, run-time
performance and robustness.  

I'll be working on putting together easily downloadable/runnable
packages with the various unit and integration tests that will be used
as part of the release criteria.

We will also need to make a pass over the bug database, identifying
and fixing high-priority bugs.

Port maintainers: the new ABI uses two kinds of thunks.  For now, we
only have assembly support for one kind of thunk; I will add the
appropriate bits for x86 sometime soon.  Using that as a model, it
should be easy to implement the new kind of thunk for other chips as
well.  The copmiler will work correctly (and be ABI compliant) [except
in one *very* obscure case: virtual functions taking variable
arguments] without assembly thunk support; the generated code will
just be a little slower.  Therefore, if you choose not to implement
the new thunk support in GCC 3.0, you can always do so later: doing so
will not break the ABI.

I'm sure we will find lots of bugs, now that the new ABI is the
default.  We'll try to fix these ASAP.  Also, it would be great if
those of you that know the new ABI could write test cases, or audit
the code, to confirm that the new ABI is actually implemented
according to the spec.  I do now know of any major issues -- but it is
certainly possible that I made mistakes while implementing the ABI, so
your eyes would be appreciated.  (I will shortly be checking in
patches to use __cxa_pure_virtual, __cxa_bad_typeid, and
__cxa_bad_cast, so you get no points for finding that one!)

I tested with the new ABI enabled on i686-pc-linux-gnu,
sparc-sun-solaris2.8, and mips-sgi-irix6.5.  I bootstrapped with this
patch on i686-pc-linux-gnu.

I'll add a news item to the website shortly.

Thanks,

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

2000-11-18  Mark Mitchell  <mark@codesourcery.com>

	* configure.in: Make --enable-new-gxx-abi the default.
	* configure: Likewise.

Index: gcc/configure.in
===================================================================
RCS file: /cvs/gcc/egcs/gcc/configure.in,v
retrieving revision 1.454
diff -c -p -r1.454 configure.in
*** configure.in	2000/11/17 23:53:38	1.454
--- configure.in	2000/11/19 04:54:32
*************** AC_ARG_ENABLE(new-gxx-abi,
*** 1605,1615 ****
  			  select the new abi for g++. You must select an ABI
  			  at configuration time, so that the correct runtime
  			  support is built. You cannot mix ABIs.],
! [AC_DEFINE(ENABLE_NEW_GXX_ABI, 1,
! 	[Define if you want to always select the new-abi for g++.])
! GXX_ABI_FLAG='-fnew-abi'
! echo "Building a new-abi g++ compiler."
! ])
  AC_SUBST(GXX_ABI_FLAG)
  
  AC_DEFINE_UNQUOTED(ENABLE_STD_NAMESPACE, $ac_esn,
--- 1605,1620 ----
  			  select the new abi for g++. You must select an ABI
  			  at configuration time, so that the correct runtime
  			  support is built. You cannot mix ABIs.],
!    ,
!   enable_new_gxx_abi=yes)
! 
! if test x$enable_new_gxx_abi = xyes; then
!   AC_DEFINE(ENABLE_NEW_GXX_ABI, 1,
! 	    [Define if you want to always select the new-abi for g++.])
!   GXX_ABI_FLAG='-fnew-abi'
! else
!   GXX_ABI_FLAG=
! fi
  AC_SUBST(GXX_ABI_FLAG)
  
  AC_DEFINE_UNQUOTED(ENABLE_STD_NAMESPACE, $ac_esn,

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]