Transitioning libgomp from C to C++ implementation
Advice on using abidiff to compare C and C++ libgomp implementations for ABI stability.
Dodji Seketeli provides guidance on how to verify ABI compatibility when transitioning libgomp from C to C++. The recommended approach involves using the abidiff tool to compare old and new library versions, ensuring no unintended changes or C++ mangling are introduced.
- proposer
Explains how to use `abidiff` to check for ABI compatibility between C and C++ versions of libgomp.
“For each platform you wish to ensure ABI stability for, build a libgomp.so.old version (the last C-only implementation maybe?) and a libgomp.so.new (the new C++ implementation) and basically do: $ abidiff libgomp.so.old libgomp.so.new No change should be reported beside potential new entry points additions. Also, maybe review the reported additions to be sure they don't have C++ mangling.”
In Details
This exchange concerns the transition of libgomp, GCC's OpenMP runtime library, from a C implementation to C++. The core issue is ensuring the C++ implementation maintains binary compatibility (ABI) with the existing C version. The advice focuses on using libabigail's abidiff tool to detect any ABI regressions or unexpected C++ name mangling.
- libgomp
- The GNU OpenMP runtime library, which provides support for OpenMP directives in GCC.
- ABI
- Application Binary Interface. Defines how compiled code communicates at the binary level, including function calling conventions and data structure layouts. Maintaining ABI compatibility is crucial for allowing independently compiled components to interoperate.
- abidiff
- A tool from the libabigail library used to compare the ABIs of two versions of a library or executable, highlighting differences.
- C++ mangling
- The process by which C++ compilers alter function and variable names to encode additional information (like argument types and namespaces) into the symbol names, allowing for function overloading and other C++ features. This can affect symbol resolution if not handled carefully across library versions.