Back Home

Table of Contents

The C++ ABI

The ABI (Application Binary Interface) is the bit-for-bit representation that the types and functions of a language have.

In C++’s case, this includes struct layout, the argument and return types of a function, the special members of a class, and virtual functions.

There’s a lot of sentiment to break ABI in C++, because this would allow performance gains for associative containers, and wouuld’ve removed some stdlib containers like lock_guard.

(cor3ntin 2020) (Meneide 2022) (Meneide 2021)

For these reasons, Rust doesn’t have a stable ABI – the compiler is free to break anything at any time.

Maybe there’s a better way, using symbol versioning.

References

cor3ntin. 2020. “The Day the Standard Library Died.” 2020. https://cor3ntin.github.io/posts/abi/.
Meneide, JeanHeyd. 2021. “Binary Banshees and Digital Demons.” 2021. https://thephd.dev/binary-banshees-digital-demons-abi-c-c++-help-me-god-please.
———. 2022. “To Save c, We Must Save ABI.” 2022. https://thephd.dev/to-save-c-we-must-save-abi-fixing-c-function-abi.
View history for this file: on Github