<p dir="ltr">Brief thoughts... I think it would be desirable to be able to have more than one stable ABI along side the"next" ABI. For example, FreeBSD and Mac might want to different stable ABIs.</p>
<p dir="ltr">Also, I'd like a more friendly interface for users of the unstable ABI than an internal libc++ macro... Maybe a clang switch could house it?</p>
<div class="gmail_quote">On Oct 1, 2013 6:43 PM, "Peter Collingbourne" <<a href="mailto:peter@pcc.me.uk">peter@pcc.me.uk</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
These thoughts are motivated by my rejected std::deque patch.<br>
<br>
In general I don't think we have a good mechanism for making<br>
ABI-breaking changes in libc++.  The existing mechanism is to<br>
increment _LIBCPP_ABI_VERSION and make all ABI-breaking changes in<br>
the same commit along with the increment.  This makes it difficult for<br>
ABI-breaking changes to be developed incrementally, as there is no good<br>
place to keep the changes until the ABI-breaking megapatch; complicates<br>
debugging, as it would be difficult to bisect an ABI-breaking megapatch;<br>
and fails to accommodate implementors who are not constrained by ABI<br>
compatibility requirements.<br>
<br>
The proposal I have in mind is to introduce a macro, _LIBCPP_ABI_NEXT,<br>
which all ABI-breaking changes are made conditional on.  Defining this<br>
macro will cause _LIBCPP_ABI_VERSION to be defined to some arbitrary<br>
non-numeric value, such as "next" (without quotes).  The lib/buildit<br>
and test/testit scripts are modified so that the library can be built<br>
and tested with or without _LIBCPP_ABI_NEXT defined.  Any implementor<br>
who does not have ABI compatibility requirements for libc++ may compile<br>
the library with _LIBCPP_ABI_NEXT defined, but the implementor must<br>
ensure that the compiler defines this macro in every C++ translation<br>
unit.<br>
<br>
When we are ready to make an ABI transition, the value of<br>
_LIBCPP_ABI_VERSION is incremented and every place in the source code<br>
which is conditional on the definition of _LIBCPP_ABI_NEXT is updated<br>
as if the macro were defined.<br>
<br>
Thoughts?<br>
<br>
Thanks,<br>
--<br>
Peter<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>