This is the mail archive of the gcc-bugs@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]

Re: g++ / CC compatibility


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


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