delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/21/07:08:08

Date: Tue, 21 Oct 1997 13:03:14 +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>
cc: djgpp AT delorie DOT com, DJ Delorie <dj AT delorie DOT com>
Subject: Re: compiling C++ with -a switch
In-Reply-To: <8878ADA6D7A@ami1.md.essd.northgrum.com>
Message-ID: <Pine.SUN.3.91.971021130213.3667C-100000@is>
MIME-Version: 1.0

On Mon, 20 Oct 1997, Ed Wallace wrote:

> I'm trying to compile a program using the -a option so that I can 
> automate branch coverage of my program when testing it.  There should 
> be a bb.out file produced when the program is run but there isn't.  
> Does anyone know what I'm doing wrong?

This seems to be a bug in the way libgcc.a is compiled when GCC is
built.  The HAVE_ATEXIT symbol is not defined in the DJGPP-specific
headers, and so the code which installs the coverage-reporting
function to be called at program exit is ifdef'ed away.

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.

I can mail you uuencoded libgcc.a, if you need this feature to work but 
don't want to rebuild GCC.

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
***************
*** 7,12 ****
--- 7,14 ----
  
  #define YES_UNDERSCORES
  
+ #define HAVE_ATEXIT
+ 
  #include "i386/gas.h"
  
  #ifdef CPP_PREDEFINES

- Raw text -


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