Concept
ABI Stability
ABI stability is the ability for compiled components to keep calling each other correctly across compiler, library, language, or operating-system changes without recompilation.
Related languages
What ABI Stability Means
An application binary interface defines how compiled code calls other compiled code. It includes calling conventions, register use, stack layout, symbol names, object layout, exception handling rules, alignment, dynamic linking behavior, and other details below the source-code API.
ABI stability means those details remain compatible enough that compiled clients and compiled libraries can keep working together. Source compatibility is weaker: code may still compile after a change, but already-built binaries might need recompilation.
Assembly code sits directly on this contract. A function written in assembly may be source-compatible with itself for years but still break binary callers if it changes callee-saved register handling, stack alignment, unwind metadata, symbol visibility, or argument layout.
Why C Is Common At Boundaries
C is frequently used as the interoperability surface because many platforms define stable C calling conventions and dynamic-library behavior. That does not make every C library safe or portable, but it gives other languages a common denominator for FFI.
C++ is harder because templates, overloads, name mangling, exceptions, standard-library types, and object layout can vary by compiler and platform ABI. Swift made ABI stability a major milestone because Apple platform libraries needed stable binary interfaces for apps and OS frameworks.
Watch Points
ABI promises are platform-specific. The same language can have stable ABI rules on one target and no stable ABI promise on another. Compiler flags, standard-library versions, target triples, linkers, and build modes can all affect binary compatibility.
Public plugin systems, native extensions, operating-system integrations, and long-lived shared libraries need ABI review early. Internal applications that rebuild all components together may be able to rely on source-level compatibility instead.
Related Concepts
ABI stability is central to Foreign Function Interface, Compilation Targets, Build Systems, and Manual Memory Management.
Sources
Last verified:
- x86-64 psABI x86 psABI maintainers
- x64 calling convention Microsoft Learn
- Procedure Call Standard for the Arm 64-bit Architecture Arm
- Swift 5 ABI Stability and More Swift.org
- The Rust Reference - External blocks Rust Project
- Itanium C++ ABI Itanium C++ ABI
- Java Native Interface Specification Oracle