www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/08/25/13:17:45

Message-Id: <199808251810.UAA37368@ieva06.lanet.lv>
From: "Andris Pavenis" <pavenis AT lanet DOT lv>
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>, djgpp-workers AT delorie DOT com,
robert DOT hoehne AT gmx DOT net,
"Salvador Eduardo Tropea (SET)" <salvador AT inti DOT gov DOT ar>
Date: Tue, 25 Aug 1998 20:13:59 +0300
MIME-Version: 1.0
Subject: Re: GCC incompatibilities
In-reply-to: <m0zBLE6-000S4tC@inti.gov.ar>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 980825143624 DOT 7520F-100000 AT is>

From:           	"Salvador Eduardo Tropea (SET)" <salvador AT inti DOT gov DOT ar>
Organization:   	INTI
To:             	Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>, djgpp-workers AT delorie DOT com,
       	robert DOT hoehne AT gmx DOT net
Subject:        	Re: GCC incompatibilities

> Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> wrote:
> 
> > 
> > On Mon, 24 Aug 1998, Andrew Crabtree wrote:
> > 
> > > > compatibility problems between object files produced by 
> > > > different versions of GCC.
> > > In many cases, yes.  Most seem to be related to c++ stuff.
> > 
> > Are there *any* problems whatsoever related to C?  For example, is the
> > stock libc.a good for GCC 2.8.1/EGCS/PGCC?
> > 
> > > The biggest gotchas here have been exception handling and rtti I
> > > think.
> > 
> > Is Robert's recommendation to use -fno-exceptions -fno-rtti at all
> > relevant to C programs which mix objects compiled by different
> > versions of GCC?
> 
> Here is my limited experience (only gcc 2.7.2 to 2.8.0):
> 
> It affects only C++ C libraries can be mixed. You can't mix C++ libraries 
> because 2.8.0 adds some hidden members so when you link 2.8.0 code with 2.7.2 
> libraries the linker looks for these hidden members and the linkage fails.
> Looks like -fno-exceptions -fno-rtti avoids the hidden members and hence you 
> can link without problems.
> 

It looks like that. I haven't met any incompatibilities between C 
libraries (gcc-2.7.2.1, gcc-2.8.0, gcc-2.8.1, egcs-2.91.53, egcs-
2.91.54 for DJGPP). 

I can mention some incompatibilities for C++ libraries:
   -  libstdc++ compiled with gcc-2.8.0 is unusable with gcc-2.8.1
      (the problem is that some destructors are not external with 
      gcc-2.8.0, some iostream classes suffers from that, gcc-2.8.0   
      is only version that has this problem AFAIK)
   -  changes in exceptions support causes C++ libraries                
      incompatible between following groups of versions:
           1) gcc-2.7.2.X
           2) gcc-2.8.1, egcs-1.0.3 (I exclude gcc-2.8.0 due to problem
               I mentioened above, I also didn't test previous egcs         
               versions). I have tested egcs-1.0.3 only under Linux.
               For Slackware-3.5  gcc-2.8.1 binary archive does not       
               contain libstdc++. The same version from egcs-1.0.3
               archive is being used (gcc-2.8.1 archive is in contrib
               directory)
           3) Latest development snapshots of egcs-1.1 (2.91.5X):
               libgcc.a no more contains symbol __eh_pc and as          
               the  result C++ object file compiled with gcc-2.8.1 or
               egcs-1.0.3 cannot be more used. Perhaps turning
               exceptions support off can fix the problem, but I have not
               tested this.

Andris

- Raw text -


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