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

Steve Langasek steve.langasek at ubuntu.com
Tue Jun 12 19:07:27 UTC 2012

On Tue, Jun 12, 2012 at 11:24:53AM -0700, Chase Douglas wrote:
> If I understand the comment correctly, this can be distilled to:

> App calls func(), which is defined by both lib1 and lib2. lib1 and lib2
> have different ABIs. App crashes when linked in the wrong order because
> the called func() may have a different ABI than the app expects.

Not quite.  It's: app calls lib1_func(), defined only in lib1, and
lib1_func() calls cxx_helper_func(), which exists in both lib1 and lib2
with different ABIs because it's generated at compile time and is sensitive
to the standard in use.  So resolution of cxx_helper_func() either needs to
somehow be kept local to the library calling it (which is what
-Wl,-B,symbolic-functions should help with), or you can't safely mix
libraries that have different targets even if they aren't intentionally
exporting C++ interfaces.

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/2a48a16b/attachment.pgp>

More information about the ubuntu-devel mailing list