delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/22/05:04:48

Date: Wed, 22 Oct 1997 10:53:46 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Ed Wallace <wallace AT ami1 DOT md DOT essd DOT northgrum DOT com>, djgpp AT delorie DOT com,
Andrew Crabtree <andrewc AT rosemail DOT rose DOT hp DOT com>
Subject: Re: compiling C++ with -a switch
In-Reply-To: <Pine.SUN.3.91.971021130213.3667C-100000@is>
Message-ID: <Pine.SUN.3.91.971022104822.7037J-100000@is>
MIME-Version: 1.0

On Tue, 21 Oct 1997, I wrote:

> I added the missing definition (see the patch below) and rebuilt
> libgcc.a; linking a test program with the patched library produced
> bb.out as you'd expect.
> 
> diff -c config/i386/go32.h~0 config/i386/go32.h
> *** config/i386/go32.h~0	Fri May 12 17:24:30 1995
> --- config/i386/go32.h	Tue Oct 21 12:07:12 1997

DJ Delorie pointed out that this patch was dangerous, since HAVE_ATEXIT is
used by other parts of libgcc.  Sorry I didn't catch this myself.  To make
the patch right, remove the patch to config/i386/go32.h I posted in my
previous message and apply the patch below to libgcc2.c, then rebuild GCC.

(Andrew, can you please see if this patch still applies to the latest 
snapshots?  I will then send it to the GCC maintainers.  Thanks.)

diff -c libgcc2.c~0 libgcc2.c
*** libgcc2.c~0	Sun Nov 26 19:39:20 1995
--- libgcc2.c	Tue Oct 21 17:26:40 1997
***************
*** 1611,1616 ****
--- 1611,1627 ----
      }
  }
  
+ #ifdef ON_EXIT
+ # define INSTALL_BB_EXIT(FUNC)  ON_EXIT (__bb_exit_func, 0)
+ #else
+ # ifdef __DJGPP__
+ extern void atexit (void (*) (void));
+ #  define INSTALL_BB_EXIT(FUNC)  atexit (FUNC)
+ # else
+ #  undef INSTALL_BB_EXIT
+ # endif
+ #endif
+ 
  void
  __bb_init_func (struct bb *blocks)
  {
***************
*** 1620,1629 ****
    if (blocks->zero_word)
      return;
  
! #ifdef ON_EXIT
    /* Initialize destructor.  */
    if (!bb_head)
!     ON_EXIT (__bb_exit_func, 0);
  #endif
  
    /* Set up linked list.  */
--- 1631,1640 ----
    if (blocks->zero_word)
      return;
  
! #ifdef INSTALL_BB_EXIT
    /* Initialize destructor.  */
    if (!bb_head)
!     INSTALL_BB_EXIT (__bb_exit_func);
  #endif
  
    /* Set up linked list.  */

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019