945a946,949
> # For Link Time Optimization, the optimisation flags used to compile
> # individual files are decoupled from those used at link time
> # (i.e. you can compile with -O3 and perform LTO with -O0), so we need
> # to also update the linker flags based on the target.
952c956,958
< # opt, fast, prof and perf all share the same cc flags
---
> # opt, fast, prof and perf all share the same cc flags, also add
> # the optimization to the ldflags as LTO defers the optimization
> # to link time
954a961,965
> ldflags[target] += ['-O3']
>
> ccflags['fast'] += env['LTO_CCFLAGS']
> ldflags['fast'] += env['LTO_LDFLAGS']
>