Date: Wed, 22 Oct 1997 10:53:46 +0200 (IST) From: Eli Zaretskii To: Ed Wallace , djgpp AT delorie DOT com, Andrew Crabtree Subject: Re: compiling C++ with -a switch In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk 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. */