Martin, Have you tried running the orginal test case from http://gcc.gnu.org/ml/gcc-patches/1999-12n/msg00664.html
with gcc 3.1 built without the g++-cxa-atexit.dpatch. Both HJ Lu and Jakub Jelinek have been trying to make clear that since glibc 2.2 the -fuse-cxa-atexit is unnecessary because __cxa_atexit is no provide through the glibc atexit call. That is why you can build gcc 3.1 without the patch and it passes the test case with or without being compiled with -fuse-cxa-atexit. The patch is totally uncessary. Jack ----------------------------------------------------------- >From [EMAIL PROTECTED] Sat Jun 1 22:16:07 2002 Date: Sat, 1 Jun 2002 19:15:36 -0700 From: "H . J . Lu" <[EMAIL PROTECTED]> To: Jack Howarth <[EMAIL PROTECTED]> Subject: Re: PATCH: Add --enable-__cxa_atexit References: <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <[EMAIL PROTECTED]>; from [EMAIL PROTECTED] on Sat, Jun 01, 2002 at 09:08:54PM -0400 On Sat, Jun 01, 2002 at 09:08:54PM -0400, Jack Howarth wrote: > HJ, > I have gone back over the debian mailing list and found > the origin of their g++-cxa-atexit.dpatch which does... > > --- src/gcc/cp/decl2.c~ Wed Jun 6 23:51:11 2001 > +++ src/gcc/cp/decl2.c Sat Jun 23 13:40:36 2001 > @@ -401,7 +401,7 @@ > /* Nonzero to use __cxa_atexit, rather than atexit, to register > destructors for local statics and global objects. */ > > -int flag_use_cxa_atexit; > +int flag_use_cxa_atexit = 1; > > /* Nonzero to not ignore namespace std. */ > > The origin is in... > > http://lists.debian.org/debian-gcc/2001/debian-gcc-200106/msg00126.html > http://gcc.gnu.org/ml/gcc-patches/1999-12n/msg00664.html > It isn't needed by the current glibc. I will recommend to drop this patch from Debian's gcc. I won't apply that patch to my gcc 3.1 nor do any tests with it. H.J. ------------------------------------------------------------------------- >From [EMAIL PROTECTED] Sat Jun 1 22:24:27 2002 Date: Sat, 1 Jun 2002 19:23:57 -0700 From: "H . J . Lu" <[EMAIL PROTECTED]> To: Jack Howarth <[EMAIL PROTECTED]> Subject: Re: debian References: <[EMAIL PROTECTED]> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <[EMAIL PROTECTED]>; from [EMAIL PROTECTED] on Sat, Jun 01, 2002 at 05:32:24PM -0400 On Sat, Jun 01, 2002 at 05:32:24PM -0400, Jack Howarth wrote: > HJ, > Debian has just upgraded to gcc 3.1.1-pre1 from the cvs but it seems > they still have the patch for using __ca_atexit in place. Are you going > to try a gcc build there with that feature enabled and debug binutils > to see why the testsuite has the s records failure? > I ask because the traffic on the gcc mailing list was confused yesterday. > I got the impression in the end that you had decided to try to help > regress all use of __ca_atexit out of gcc or was that incorrect? Do other But Jakub convinced me that Linux doesn't need __ca_atexit from gcc. I decided not to bother. > OS's beside linux need that? I know it was claimed that atexit in linux > was as fast as __ca_atexit but I was unclear if some other OS needed that > to be retained in gcc. Thanks for any clarification. Any OS which has __ca_atexit can make its atexit safe. From glibc: /* This is defined by newer gcc version unique for each module. */ extern void *__dso_handle __attribute__ ((__weak__)); /* Register FUNC to be executed by `exit'. */ int atexit (void (*func) (void)) { return __cxa_atexit ((void (*) (void *)) func, NULL, &__dso_handle == NULL ? NULL : __dso_handle); } H.J. ------------------------------------------------------------------------ >From [EMAIL PROTECTED] Sat Jun 1 22:43:59 2002 Date: Sat, 1 Jun 2002 19:43:28 -0700 From: "H . J . Lu" <[EMAIL PROTECTED]> To: Jack Howarth <[EMAIL PROTECTED]> Subject: Re: PATCH: Add --enable-__cxa_atexit References: <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <[EMAIL PROTECTED]>; from [EMAIL PROTECTED] on Sat, Jun 01, 2002 at 10:31:46PM -0400 On Sat, Jun 01, 2002 at 10:31:46PM -0400, Jack Howarth wrote: > patch is totally unnecessary. I am still quite puzzled as to why > the test case pases with or without -fuse-cxa-atexit and the > a.out seems to have _use_cxa_atexit in it in both cases. This > seems to suggest that gcc now detects __cxa_atexit support No, that __cxa_atexit comes from glibc. When you use atexit, which gcc 3.1 does, glibc will make sure __cxa_atexit is used. Check out /usr/lib/libc_nonshared.a and /usr/lib/libc.so. That is why -fuse-cxa-atexit is useless for Linux, or for any OS which has __cxa_atexit for that matter. H.J. ------------------------------------------------------------------------------ Jack W. Howarth, Ph.D. 231 Albert Sabin Way NMR Facility Director Cincinnati, Ohio 45267-0524 Dept. of Molecular Genetics phone: (513) 558-4420 Univ. of Cincinnati College of Medicine fax: (513) 558-8474 -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]