[cfe-dev] Current state of libcxx compatibility with libstdc++
David Chisnall via cfe-dev
cfe-dev at lists.llvm.org
Tue Aug 9 09:04:23 PDT 2016
On 9 Aug 2016, at 16:45, Martin J. O'Riordan via cfe-dev <cfe-dev at lists.llvm.org> wrote:
> It is usually not even possible to pass Standard C++ objects between libraries that have been built with different versions of the "same" implementation of Standard C++ libraries, as it is not at all unusual for the library implementator to refactor the implementation of the Standard types, with a substantial amount of the implementation residing in the headers.
> The compilers themselves generally go to considerable lengths to ensure that the same code compiled with different versions of the compiler are binary compatible, but the C++ Standard Library headers usually break object compatibility because the code is "not" the same code.
> I haven't checked recently (v3.8 to v3.9), but this is usually the case from one release of CLang's own LibC++ to another.
Binary (backwards) compatibility is most definitely a goal for libc++. Please file bugs if you find them - any ABI-breaking changes should be behind #ifdefs so that downstream users can enable them on their own timescales. I believe libstdc++ also tries to provide these guarantees, though they did need some ABI-breaking changes for c++11 compatibility.
More information about the cfe-dev