1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-21 13:34:06 +03:00

meson: Allow larger stack frames when instrumenting

When enabling sanitizers, gcc adds some instrumentation to the code
that may enlarge stack frames. Some function's stack frames are already
close to the limit of 4096 and are enlarged past that threshold,
e.g. virLXCProcessStart which reaches a frame size of 4624 bytes.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Tim Wiederhake 2021-05-06 17:08:32 +02:00 committed by Michal Privoznik
parent 55ea45acc9
commit c46556c280

View File

@ -224,6 +224,9 @@ alloc_max = run_command(
'print(min(2**(@0@ * 8 - 1) - 1, 2**(@1@ * 8) - 1))'.format(ptrdiff_max, size_max),
)
# sanitizer instrumentation may enlarge stack frames
stack_frame_size = get_option('b_sanitize') == 'none' ? 4096 : 8192
cc_flags += [
'-fasynchronous-unwind-tables',
'-fexceptions',
@ -279,7 +282,7 @@ cc_flags += [
'-Wformat-y2k',
'-Wformat-zero-length',
'-Wframe-address',
'-Wframe-larger-than=4096',
'-Wframe-larger-than=@0@'.format(stack_frame_size),
'-Wfree-nonheap-object',
'-Whsa',
'-Wif-not-aligned',