RTEMS and link-time optimization

Jonathan Brandmeyer jbrandmeyer at planetiq.com
Fri Mar 8 23:43:33 UTC 2019


I couldn't help but notice that by default, the RTEMS source builder
produces a build of GCC that doesn't support LTO.  A wee bit of
source-diving showed that it can be enabled (and forwarded to GCC's
configure) with the --with-lto option, though.

Having worked on getting LTO to work on embedded systems in the past,
it can reveal a host of special bugs in startup code and inline
assembly that otherwise work just fine in the absence of LTO.  For
example, inline ARM assembly can fail to work correctly when you use
the `ldr <register>, =symbol` idiom for loading an absolute address to
a symbol, but works just fine when you pass the symbol's address as an
argument to the assembly template.

With that in mind, does RTEMS support (is regularly tested with) LTO?

Thanks,
Jonathan Brandmeyer


More information about the users mailing list