Date: Sun, 30 Aug 1998 19:37:43 +0200 (MET DST) From: Hans-Bernhard Broeker To: DJ Delorie cc: djgpp-workers AT delorie DOT com Subject: Re: c++ linking faq In-Reply-To: <199808291450.KAA08185@delorie.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk 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.