<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 8, 2014 at 2:35 PM, Lawrence Velázquez <span dir="ltr">&lt;<a href="mailto:larryv@macports.org" target="_blank">larryv@macports.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":22x" class="a3s" style="overflow:hidden">So if we start using our own libc++abi on older OS X, wouldn&#39;t C++ binaries built with Xcode&#39;s compilers be unable to interoperate with binaries built with MacPorts compilers?<br></div></blockquote></div><br>Only if you try to use it for pre-C++11; but in that case we use the system&#39;s runtime.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Short history lesson:</div><div class="gmail_extra"><br></div><div class="gmail_extra">Originally, C++ did not have a formal runtime ABI/API; the C++ standard specifically said that it was compiler specific. As a result, C++ compilers generally did not interoperate at all.</div><div class="gmail_extra"><br></div><div class="gmail_extra">C++11 recognized that this was a problem and formalized the API. All C++11 compatible compilers use the same runtime API and can interoperate.</div><div class="gmail_extra"><br></div><div class="gmail_extra">libstdc++ vs. libc++ tends to be a proxy for this conflict on OS X, because Apple had been shipping the last GPL2-licensed libstdc++, which did not have C++11&#39;s API. Apple won&#39;t ship GPL3, so they won&#39;t update libstdc++ to support C++11; instead they started shipping libc++, which supports C++11 and is not GPL3. But the fundamental problem is not libc++ vs. libstdc++; if you are not hampered by GPL3 (as on Linux), you can use a modern libstdc++ interchangeably with libc++.</div><div class="gmail_extra"><br></div><div class="gmail_extra">So the cases here are:</div><div class="gmail_extra"><br></div><div class="gmail_extra">- pre-C++11 C++ support must use the system libstdc++ (the binary-only backward compatibility one on newer systems whose development C++ runtime is libc++).</div><div class="gmail_extra"><br></div><div class="gmail_extra">- C++11 C++ support must either face the license issue of a later libstdc++ or use libc++. In either case, the system C++ runtime cannot be used on older systems. On newer systems where Apple shipped C++11, the system runtime is libc++ and C++11 compatible, so use it.<br><br clear="all"><div>- The case of pre-C++11 libc++ does not come up because Apple has not to my knowledge ever shipped this.</div><div><br></div><div>In summary, on pre-C++11 systems you need to provide a different C++ runtime no matter what; on C++11 systems you can always use Apple&#39;s runtime.</div><div><br></div>-- <br><div dir="ltr"><div>brandon s allbery kf8nh                               sine nomine associates</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a>                                  <a href="mailto:ballbery@sinenomine.net" target="_blank">ballbery@sinenomine.net</a></div><div>unix, openafs, kerberos, infrastructure, xmonad        <a href="http://sinenomine.net" target="_blank">http://sinenomine.net</a></div></div>
</div></div>