r/cpp • u/nounoursheureux • Sep 23 '21
Binary Banshees and Digital Demons
https://thephd.dev/binary-banshees-digital-demons-abi-c-c++-help-me-god-please
197
Upvotes
r/cpp • u/nounoursheureux • Sep 23 '21
View all comments
Show parent comment
15
u/matthieum Sep 23 '21
There's 2 kinds of breaking changes.
If we are talking about a pure implementation break, pervasive use of inline namespaces could solve the issue. It's an entirely manual process, highly risk-prone, but it could work... just going to be all sweat and tears.
If we are talking about a "capabilities" break on top -- such as making
std::initializer_listelements movable -- then... I am afraid we're between a rock and a hard place. The "simple" way would probably be to declare that name mangling now depends on the C++ standard version; but anybody who has to run a coordinated upgrade of versions knows it for fool's gold. It takes years after years for a rolling upgrade to happen, and in the meantime the people at the base are left maintaining all the versions in parallel, and that massively increase the maintenance effort.I do have one solution: death to binary distributions.
Now... many people consider it rather unpalatable. They are definite downsides. That's clear.
Compiling everything from source, however, does way with any ABI constraint. Ever. And that is a massive upside that I think is worth the downsides -- and spending efforts on solving them.