Keeping the ABI [somewhat] sane

By Gabriel F. T. Gomes, IBM

ABI changes in libraries are inevitable. Usually this does not have any impact on software that depends on it, nor does it require more than the usual downstream effort. However, when the change renders the new library incompatible with its previous versions, the hassle is great: programs stop working or produce weird results, and package maintainers see themselves forced to concurrently distribute two versions of the library. Yet, sometimes, incompatible ABI changes are the only option that upstream developers have.

Luckily, modern compiler toolchains, such as GNU’s Binutils, GCC, Glibc, and friends, offer mechanisms to allow such incompatible changes to the ABI to become less troublesome. Binutils’ VERSION command allows a symbol, such as a function name, to be exposed more than once by the library and with version information, thus allowing old and new software to work correctly with the same library. GCC’s preprocessor can redirect function calls during build time, thus allowing new software to use older implementations of an ABI if that is somehow desired. The Glibc project uses both mechanisms in order to remain fully backwards-compatible while still accommodating large changes to its ABIs.

This presentation will briefly explain how the aforementioned mechanisms work and how to use them to produce a stable, yet evolving library. Starting with simple, fictional examples, then moving to a case-study of the recent changes to the long double format on the 64-bits, little-endian ABI on PowerPC, the listener will be able to understand how the C library of many free software distributions evolves without breaking hundreds of programs


I am a programmer. At IBM, I write code for some system libraries, such as Glibc and libdfp, as well as I maintain the advance-toolchain. At Debian, I am the maintainer for bash-completion and pragha. I have very little experience as a speaker (none this year; last year I presented at Islene’s “Seminários de Software Livre” (in Portuguese); the year before that to a couple of friends at the 2016 edition of “Software Freedom Day at Campinas”; all other experiences were to a small room of students or coworkers).