[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: is g++-cxa-atexit.dpatch still needed



   Here is another message from Jakub on the complete unnecessity
of debian using the patch...
                                    Jack
---------------------------------------------------------------
>From jakub@sunsite.ms.mff.cuni.cz Sun Jun  2 01:15:44 2002
Date: Sun, 2 Jun 2002 07:15:44 +0200
From: Jakub Jelinek <jakub@redhat.com>
To: Jack Howarth <howarth@bromo.med.uc.edu>
Cc: gcc@gcc.gnu.org
Subject: Re: why debian uses --use-cxa-atexit
Reply-To: Jakub Jelinek <jakub@redhat.com>
References: <200206012321.TAA80410@bromo.msbb.uc.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.2.5.1i
In-Reply-To: <200206012321.TAA80410@bromo.msbb.uc.edu>; from howarth@bromo.med.uc.edu on Sat, Jun 01, 2002 at 07:21:20PM -0400

On Sat, Jun 01, 2002 at 07:21:20PM -0400, Jack Howarth wrote:
>    I've gone back through the debian-gcc mailing list and found
> the origin of debian using --use-cxa-atexit in their gcc 3.x
> compiler builds. It is in the thread starting with...
> 
> http://lists.debian.org/debian-gcc/2001/debian-gcc-200106/msg00126.html
> 
> which basically says that they are using --use-cxa-atexit because
> global destructors are not run in the correct order. They got this
> from http://gcc.gnu.org/bugs.html#known which has...
> 
> Global destructors are not run in the correct order.
> 
> Global destructors should be run in the reverse order of their
> constructors completing. In most cases this is the same as the reverse
> order of constructors starting, but sometimes it is different, and that
> is important. You need to compile and link your programs
> with --use-cxa-atexit. We have not turned this switch on by default, as
> it requires a cxa aware runtime library (libc, glibc, or equivalent).
> 
> Is this information still accurate for gcc 3.1? It would seem this is the 
> only reason debian is using --use-cxa-atexit. Thanks for any clarifications.

It is not about being or not being accurate for gcc 3.1, it is about glibc
2001-02-26 or later having:

/* 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);
}

/* Hide the symbol so that no definition but the one locally in the
   executable or DSO is used.  */
#ifdef HAVE_DOT_HIDDEN
asm (".hidden\tatexit");
#endif

in /usr/lib/libc_nonshared.a (and exporting atexit from libc.so only
as compatibility symbol version, so nothing newly linked can use it).

        Jakub

---------------------------------------------------------------------------


-- 
To UNSUBSCRIBE, email to debian-gcc-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: