[SeaBIOS] Experiences with link time optimization?

Kevin O'Connor kevin at koconnor.net
Fri Apr 25 02:22:27 CEST 2014


On Fri, Apr 25, 2014 at 12:06:57AM +0200, Paul Menzel wrote:
> Dear SeaBIOS folks,
> 
> 
> in #coreboot on <irc.freenode.net> Stefan mentioned that link time
> optimization (LTO) [1] might yield some speed improvements for coreboot
> as the resulting firmware image might be smaller and therefore it takes
> less time to read it from flash. This was confirmed with coreboot and
> GCC 4.6.0 in 2011 by Scott Duplichan [2][3].

The LTO option allows gcc to perform whole program optimization.
SeaBIOS has been using whole program optimization since SeaBIOS'
inception.  So, there wont be any further improvement to SeaBIOS code
generation in this area.

Currently, SeaBIOS passes all the source code to gcc as one
compilation unit (by effectively concatenating all the code into one
big file) to accomplish the whole program optimization.  The gcc -lto
stuff allows one to use a more traditional compilation of one source
file at a time while still obtaining the benefits of whole program
optimization.  I played with the -lto option quite a bit a year or so
back, but I've found it to be finicky when working with other
necessary build options (eg, for building the code in 16bit mode),
it's been changing a little as new versions of gcc are released, and
it seems to produce less optimized code then the current mechanism.
Might be worth a look again after things have stabilized a bit in gcc
(but only to make the build more traditional).

-Kevin



More information about the SeaBIOS mailing list