This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Exceptions workaround for older systems that don't USE_COLLECT2
- To: egcs at cygnus dot com
- Subject: Re: Exceptions workaround for older systems that don't USE_COLLECT2
- From: "Melissa O'Neill" <oneill at cs dot sfu dot ca>
- Date: Tue, 8 Sep 1998 23:18:41 -0700
- cc: Jeffrey A Law <law at cygnus dot com>, Jamie Lokier<egcs at tantalophile dot demon dot co dot uk>
- References: <6536.905317164@hurl.cygnus.com>
Jeff Law writes:
> I've enabled collect2 for the m68k nextstep port. I didn't do anything
> with the x86 port because I didn't know if it has the same problems.
>
> If the x86 next port needs this change too, let me know and I'll fix
> it too.
Yes, the x86 port should need to use collect as well. Ditto for HPPA
and SPARC NEXTSTEP versions, if they are supported by EGCS. It's the
same basic linker and object format, so their behaviour should be
more-or-less identical across processor architectures.
I had claimed:
>> [It would] be cool if g++ could skip the double-link/collect2 business
>> when -fno-exceptions is in effect, but I doubt anyone is going to
>> take the time to implement that.
... and Jeff replied, saying:
> This would not be safe.
>
> Even if your program does not use exceptions, you may be linking to
> a library that does use exceptions internally.
Interesting. I had thought that linking code that used exceptions
together with code that doesn't use them had unspecified results anyway
(at least in general, if you're allowed to use pointers to functions,
have call-backs, etc.), or am I mistaken?
Someone could probably argue that invoking g++ to link object files and
specifying `-fno-exceptions' could be seen as an assertion that none of
the object files or libraries use exceptions, but the argument is academic
anyway since no one is poised to implement such a feature...
Melissa.