meson: use "-fno-asynchronous-unwind-tables" for non-debug builds

This removes the DWARF stack unwinding tables, which shrinks the
".eh_frame" and ".eh_frame_hdr" sections by about 24KiB. Stack
unwinding tables are pretty useless to a C program compiled in
release mode.
This commit is contained in:
Craig Barnes 2020-08-19 17:22:21 +01:00
parent c0ddb78f4a
commit ce57bfa1ea

View file

@ -14,7 +14,9 @@ cc = meson.get_compiler('c')
add_project_arguments(
['-D_POSIX_C_SOURCE=200809L', '-D_GNU_SOURCE=200809L'] +
(is_debug_build ? ['-D_DEBUG'] : []) +
(is_debug_build
? ['-D_DEBUG']
: [cc.get_supported_arguments('-fno-asynchronous-unwind-tables')]) +
cc.get_supported_arguments(
['-fstrict-aliasing',
'-Wstrict-aliasing']),