GCC 4.7, STL and binary compatibility of objects built with different language standards

Steve Langasek steve.langasek at ubuntu.com
Tue Jun 12 17:38:58 UTC 2012

Hi Matthias,

On Tue, Jun 12, 2012 at 07:30:33PM +0200, Matthias Klose wrote:
> The problem happens because both libs contains a (weak) definition of
> the equal_range function.  As the libs don't control their exports this
> symbol also is exported.  Hence the calls will be resolved to whatever
> version comes first in dynamic linker search order (that's the reason
> for the two apps built, once with "-l1 -l2", once with "-l2 -l1").

> So, whichever library is first in search order, the other library will
> resolve its own equal_range call (stemming from the inlined erase) to that
> first library, and thereby crash because that version was compiled with
> different c++ ABI."""

Is this something that the unity team (since they have full upstream control
of their libs) could guard against by restricting the list of exported
symbols?  Does -Wl,-B,symbolic-functions help at all in this case?

Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slangasek at ubuntu.com                                     vorlon at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/ubuntu-devel/attachments/20120612/7cf47a99/attachment-0001.pgp>

More information about the ubuntu-devel mailing list