On 12/4/22 11:40, Peter Maydell wrote:
On Sun, 4 Dec 2022 at 00:04, Richard Henderson
<richard.hender...@linaro.org> wrote:
Separately control b_lto without --enable-cfi.
Also add --disable-lto for completeness.
Before this patch, CFI defaults to false and therefore LTO
also defaults to false. After this patch, LTO defaults to
true even if CFI is false. Intentional change ?
Nope. Oops.
Do we have figures for whether LTO produces an interesting
performance improvement ?
No idea. I wrote this after finding a bug report in which someone tried to add -flto via
--extra-cflags.
We should probably complain if the user tries '--enable-cfi --disable-lto'
rather than silently doing something that presumably doesn't work.
We do, in meson.build:
if get_option('cfi')
cfi_flags=[]
# Check for dependency on LTO
if not get_option('b_lto')
error('Selected Control-Flow Integrity but LTO is disabled')
r~