This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: g++ / CC compatibility
- To: Nevenka Bierny <NBierny at quova dot com>
- Subject: Re: g++ / CC compatibility
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 17 May 2001 14:47:07 -0300
- Cc: "'gcc-bugs at gcc dot gnu dot org'" <gcc-bugs at gcc dot gnu dot org>
- Organization: GCC Team, Red Hat
- References: <DB91BC27B91BD411B598009027E59F70678397@exchangehq.quova.com>
On May 16, 2001, Nevenka Bierny <NBierny@quova.com> wrote:
> However, speed is of importance, milliseconds do matter, therefore we would
> rather build a static library which can then be used to build an executable
> using CC or g++.
Since CC is not binary-compatible with g++, even if you manage the
linkage to succeed, you'll still have problems at run-time. For
example, cout is defined in both CC's and g++'s C++ shared libraries,
and it will be initialized by both, but it's expected to have a
different object layout by each library. Crashes result.
So, if you're sure you don't use any of the conflicting symbols, you
may go ahead and just link the static libstdc++ and libgcc into the CC
application, *after* its own built-in C++ library.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me