help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: libstdc++.so.5 vs. libstdc++.so.6 and external libraries


From: Paul Pluzhnikov
Subject: Re: libstdc++.so.5 vs. libstdc++.so.6 and external libraries
Date: 04 Aug 2004 20:54:59 -0700
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Artificial Intelligence)

"Yuval Kfir" <yuvalk@mainsoft.com> writes:

> Paul Pluzhnikov wrote:
> > You should not link together code compiled with g++-3.3.x and 3.4.x. [...]
> 
> Can you explain the dangers here?

The dangers are that the wrong symbol will bind to the wrong reference, e.g.
if there is a global 'class exception e;' in both sets of the
objects, and if sizeof(e)-compiled-with-3.3 != sizeof(e)-compiled-with-3.4, 
or layout(e)-3.3 != layout(e)-3.4, then you have a problem.

> I ran some tests, too - besides the linker warning about a possible conflict, 

Are the warnings that a 'global symbol of different size' is being used?
If so, I'd be *very* worried.

> everything seemed to work fine. 

Programming "by accident", I see.

It will probably work, until some unrelated code change causes it
to stop working. And then you'll spend many hours looking for the cause.

Or it may be silently corrupting your client's data, and the client
will spend even more hours figuring out it is your fault :-(

> Where can I expect trouble, do you think?

If you can verify that no 'same-named global symbols with
different size or layout' exist in your code and client code, nor
in libstdc++.so.5 and libstdc++.so.6, then I *think* you should be
safe. Of course the fact that there are linker warnings, means that
you probably aren't.

Also, the mere fact that /usr/local/gcc-3.4.0/lib/libstdc++.so.6 and
/usr/local/gcc-3.3.2/lib/libstdc++.so.5 (on Linux) contain 269
potentially-conflicting symbols (globals with the same name),
should give one a pause.

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]