RTEMS and link-time optimization
joel at rtems.org
Sat Mar 9 00:02:41 UTC 2019
On Fri, Mar 8, 2019, 5:43 PM Jonathan Brandmeyer <jbrandmeyer at planetiq.com>
> 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?
I recall there being concern it would break things and need to be evaluated
and tested on all targets and maybe all BSPs.
My suggestion would be to submit a patch that adds a --with-lto option to
the source builder. That lays the groundwork to build tools with it enabled
and see how it goes.
It would be good to see size and performance measures on say SPARC, ARM,
I can see enabling it eventually on the more popular targets if they get
tested and work.
FWIW I posted a patch to fix your spelling error. Thanks
> Jonathan Brandmeyer
> users mailing list
> users at rtems.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the users