Link-time optimization for the kernel
Link-time optimization for the kernel
Posted Aug 22, 2012 8:15 UTC (Wed) by jezuch (subscriber, #52988)Parent article: Link-time optimization for the kernel
AFAIK there's another benefit of LTO: it can merge identical functions and data from multiple object files. This is especially beneficial for C++, where, for example, every time one #includes <cstream>, the compiler generates several stubs which turn out to be identical and unnecessarily duplicated. This and other optimizations usually result in about 10% reduction in the final binary's size.
That said, I notice that the kernel actually grows with LTO. The modules do get smaller - especially large ones like GPU and filesystem drivers - but not vmlinuz.
Oh, and the development version which will become GCC 4.8 reduces memory use even further. So much that it can actually build itself on my machine with 8 gigs of ram, although with some swapping :)