From: Tim Wiederhake Date: Thu, 6 May 2021 15:08:32 +0000 (+0200) Subject: meson: Allow larger stack frames when instrumenting X-Git-Tag: v7.5.0-rc1~151 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c46556c2809362b8771201bf4c8d0d4feebf2ab0;p=thirdparty%2Flibvirt.git 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 Reviewed-by: Pavel Hrdina Reviewed-by: Michal Privoznik --- diff --git a/meson.build b/meson.build index 40e99fec0c..5849975a72 100644 --- a/meson.build +++ b/meson.build @@ -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',