How to achieve ABI stability?

0 like 0 dislike
6 views
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 | 6 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
by
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.
by

Related questions

0 like 0 dislike
5 answers
0 like 0 dislike
1 answer
0 like 0 dislike
5 answers
110,608 questions
257,186 answers
0 comments
33,652 users