Hi Jim,
Thanks for your in-depth response!
If I got it right, the C++11 standard didn't mandate a new ABI, but libstdc++'s ABI would break in the new standard. Our own libc++ was created with C++11 in mind, so we required no alterations or ABI changes.
On 20 January 2016 at 23:05, Jim Wilson jim.wilson@linaro.org wrote:
It appears that a complaint from doko started this mess.
As usual... :)
Then in July, I see a third thread started by Jason Merrill that seems to have the first suggestion of using an attribute to change mangling. https://gcc.gnu.org/ml/gcc/2012-07/msg00031.html
Hum, it's not just mangling, they also changed the object layout. Now it starts to make sense.
The problem we see is with segfaults when compiling "Hello World" using iostream, but a mangling-only problem would manifest at compile time. Changing the representation of std:: objects will, most definitely, screw up things badly.
While the feature was added a while ago, it wasn't until C++11 was made the default that it became visible to end users, and that happened with GCC 5. Maybe there wasn't enough discussion with the clang guys before the switch was made from C++98 to C++11. Us gcc guys aren't used to having to discuss things with other compiler developers. We are good about talking to distro vendors, but we keep forgetting about clang.
Clang folks aren't good either, but this is exactly the kind of big deal that affects everyone I mentioned in my talk at the Cambridge cauldron (2014).
Mangling can easily be caught and fixed, but object layout is a major pain in the ass, *especially* when it's not documented, nor stable.
I found an old wiki page that talks about ABI changes between C++98 and C++11. https://gcc.gnu.org/wiki/Cxx11AbiCompatibility
That's a good start, but I doubt it covers everything.
I doubt that there is any formal specification of any of this stuff anywhere. The attribute abi_tag is documented in the gcc manual. https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Attributes.html#C_002b_002b-A... You perhaps care more about how libstdc++ uses it, which isn't in the gcc manual. I do see two mentions in the libstdc++ docs https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html https://gcc.gnu.org/onlinedocs/libstdc++/manual/api.html
Right, that's more information than is linked in the bug, I'll do that now, thanks for the pointers.
But I suspect the people involved already knew this from an early stage (maybe even since 2012). The problem is not the change per se, but how the change was done.
The design remained undocumented and was agreed upon on meetings between GCC and the Distros. The distros decided to move, didn't think about Clang, and now they're whining that Clang doesn't work.
Even though the GCC folks should have discussed such a big change with (at least) Clang folks, it's the distro folks that should have given a damn about this whole issue.
Again, thanks for the detailed response, I'll update the bug report.
cheers, --renato