It's not very hard to break binary backwards-compatibility of a DSO/shared library with a C++ interface. That said, is there a static analysis tool, which can help detecting such ABI breaks, if it's given two different sets of header files: those of an earlier state of the DSO and those of the current state (and maybe DSOs as well)? Both free and commercial product suggestions are welcome.
If it could also warn about bad practices, e.g. inline functions and defaulted function parameters in DSO interfaces, it would be great.
A technician takes your blood pressure in both of your arms using an inflatable cuff, similar to the one used in the doctor's office. The technician also measures the blood pressure in the ankles. The doctor uses these values to compute your ABI.
For the standard library the primary issues causing potential ABI breakage are those which change the layout of a class or a class template or the changing the behavior of typically inlined functions.
So does C++ have a stable ABI or not? Nope. It's implementation defined.
abi-compliance-checker - a tool for checking backward binary/source-level compatibility of a shared C/C++ library (DSO):
A tool for checking backward binary and source-level compatibility of a C/C++ library. The tool checks header files and shared libraries of old and new versions and analyzes changes in API and ABI (ABI=API+compiler ABI) that may break binary and/or source compatibility: changes in calling stack, v-table changes, removed symbols, renamed fields, etc.
icheck - C interface ABI/API checker:
A tool for statically checking C interfaces for API and ABI changes. All changes to type declarations that can cause ABI changes should be detected, along with most API changes. icheck is intended for use with libraries, as a method of preventing ABI drift.
shlib-compat - ABI compatibility checker for shared libraries with symbol versioning:
shlib-compat uses dwarf debugging symbols to recreate and compare definitions of exported symbols, including function arguments and structural types.
Also you might be interested in the linux upstream tracker and linux abi tracker services. They are both powered by the abi-compliance-checker tool.
I assume that you are familiar with this tutorial: Binary Compatibility Issues with C++, if not read it!
I've heard about this tool: http://ispras.linuxbase.org/index.php/ABI_compliance_checker, however never tested or used one, so have no opinion.
Also this may interest you: Creating Library with backward compatible ABI that uses Boost
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With