www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/08/30/13:38:19

Date: Sun, 30 Aug 1998 19:37:43 +0200 (MET DST)
From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
To: DJ Delorie <dj AT delorie DOT com>
cc: djgpp-workers AT delorie DOT com
Subject: Re: c++ linking faq
In-Reply-To: <199808291450.KAA08185@delorie.com>
Message-ID: <Pine.LNX.3.93.980830193031.28056B-100000@acp3bf>
MIME-Version: 1.0

On Sat, 29 Aug 1998, DJ Delorie wrote:

> Can we just change gcc to always try to link in the stdc++ library if
> it's installed?  I'm getting sick of that issue popping up on the
> newsgroup.

I see at least two big problems with such an approach:

1) The "if it's installed" condition probably would turn out quite tricky
to implement, at the desirable stage (specs file, or maybe linker script),
so we'ld have to hack gcc itself. I don't like that idea. 

2) This would unconditionally link in a C++ library, even if there's not a
single .cc file in the project, which might easily happen to break quite a
number of things. Given things like class constructors, we might bloat the
code beyond recognition. The only way around this I currently see would
require inspection of the .o files linked for a 'this is C++' marker.  But
that could only be done by the linker, i.e. the machinery would have to be
put into the linker script, or even into the source of the linker. Can we
use environment variable values in the linker script? 

Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


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