This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libsupc++, _cxa references, and Dinkum libcpp


On Tue, May 20, 2003 at 02:11:02PM -0000, gp@qnx.com wrote:
> Here is the output of a simple C++ compile using gcc-3.2.3 and our port of the
> Dinkum libcpp.  The Dinkumware implements 'new' and 'delete', but it has not
> presented as a problem yet, except if we try to use the libsupc++ to resolve
> the cxa symbols.  Which is why I thought that splitting the cxa stuff into a
> libcxa (that would also be linked into the libsupc++) would work.  The symbols
> in libsupc++ that conflict (multiple definitions) are:
> 
>   std::terminate()
>   std::unexpected()
>   std::set_terminate(void (*)())
>   std::set_unexpected(void (*)())

So evidently Dinkumware is also trying to provide some exception handling
support, not just new and delete.
 
> It seems to me that cc1plus should not be emitting libstdc++ specific symbols,
> thereby assuming that the c++ libs being used are only going to be GNU
> libstdc++.  Failing that, providing a libcxa of some kind would be very helpful.

All the symbols that cc1plus exports should be (and are, as far as I know)
provided by libsupc++.  That is, any symbol emitted by the compiler itself
should be satisfied by that mini-library.  You should not need libstdc++.

You are running into trouble because Dinkumware
is attempting to provide some but not all C++ support.  I think you'd be
better off stripping the conflicting symbols from Dinkumware and using
the libsupc++ symbols.  If you don't, you risk trouble later, because the
compiler may be assuming properties of the support routines that aren't
obeyed by Dinkumware.  Supporting the Dinkumware library was never a
GNU C++ goal, so if you want to make it work, great, but asking for a
redesign of libstdc++ for such a narrow goal doesn't seem reasonable to me.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]