IT lexicon › Programming › Fat LTO objects

Fat LTO objects

Programming På svenska → Updated: 2026-11-06

Object files that carry both the compiler's intermediate representation for link-time optimisation and finished machine code, so they work whether or not the link uses LTO.

Under link-time optimisation the compiler defers code generation: the object file holds only IR, GIMPLE in GCC's case, and the real compilation happens once the linker sees the whole program. Such slim objects are gibberish to any linker or tool that doesn't speak LTO. GCC made slim the default in version 4.9 in 2014; -ffat-lto-objects puts the ordinary machine code back alongside.

This matters for static libraries. A distribution that builds everything with LTO can't know whether whoever links against libfoo.a will, and a fat object works either way. The cost is double compile time and bigger files. Clang has had the same flag since LLVM 17, where it embeds bitcode inside a regular object.

← Back to the lexicon