How to achieve ABI stability?

Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
Hello, colleagues!
The last time closely engaged in the study of the stability of the ABI. For myself have developed two basic approaches:
  • to follow some of the recommendations for the selected compiler, for example, the Itanium C++ ABI;
  • lay the stability in the design of the application, for example, use the pimpl idiom.

About 2 approach there are several questions that I would like to get answers. Further, the questions imply that the public interface does not change and requires compatibility in the framework of a compiler.
  1. Dynamic library loading (dlopen, LoadLibrary, Boost.DLL). Relevant for this case problems (at least no name mangling) ABI?
  2. Pimpl:
    • Does the addition of the abstract interface on the stability of the ABI (the appearance of the vtable)?
    • How to beat the templated methods/template class?

Sorry for some confusion. Trying to write briefly.
by | 21 views

2 Answers

0 like 0 dislike
1 -- in boost.dll there is a mangled import
2 -- if not economies each byte then no
template classes use only on the client side.
Out of sticks or DLL C interface or PIMPL classes
And template helpers welling on top of them.
Export/import templates from dll evil and not supported by anyone except, like MSVC
0 like 0 dislike
In my opinion, the most stable method is to make a simple C interface libraries and provide a wrapper in C++ that the user of your libraries already he will compilate. After that, all your problems solved :)
Another solution is to wait until the 23rd of standard where, according to rumors, the ABI standardizes C++. But this is a very optimistic expectation.

Related questions

0 like 0 dislike
5 answers
0 like 0 dislike
1 answer
0 like 0 dislike
5 answers
110,608 questions
257,187 answers
40,796 users