Paolo Bonzini <[email protected]> writes:
> Il gio 6 mar 2025, 11:53 Alex Bennée <[email protected]> ha scritto:
>
> -option_cflags = (get_option('debug') ? ['-g'] : [])
> +option_cflags = []
> +if get_option('debug')
> + option_cflags += get_option('split_debug') ? ['-gsplit-dwarf'] : ['-g']
> +endif
>
> option_cflags does nothing, it's only for clarity in the final summary. So
> you need
>
> if get_option('debug') and get_option('split_debug')
> qemu_cflags += '-gsplit-dwarf'
> endif
Should I update the optimization field as well? is this the reason why I
wasn't seeing changes occur for the tests that meson builds?
>
> (I wonder if it should be implemented in meson instead... It should be
> beneficial for other projects surely).
>
> Paolo
>
> if get_option('optimization') != 'plain'
> option_cflags += ['-O' + get_option('optimization')]
> endif
> diff --git a/meson_options.txt b/meson_options.txt
> index 59d973bca0..3432123fee 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -362,6 +362,8 @@ option('debug_mutex', type: 'boolean', value: false,
> description: 'mutex debugging support')
> option('debug_stack_usage', type: 'boolean', value: false,
> description: 'measure coroutine stack usage')
> +option('split_debug', type: 'boolean', value: true,
> + description: 'split debug info from object files')
> option('qom_cast_debug', type: 'boolean', value: true,
> description: 'cast debugging support')
> option('slirp_smbd', type : 'feature', value : 'auto',
> diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
> index 3e8e00852b..aca6e68830 100644
> --- a/scripts/meson-buildoptions.sh
> +++ b/scripts/meson-buildoptions.sh
> @@ -504,6 +504,8 @@ _meson_option_parse() {
> --disable-strict-rust-lints) printf "%s" -Dstrict_rust_lints=false ;;
> --enable-strip) printf "%s" -Dstrip=true ;;
> --disable-strip) printf "%s" -Dstrip=false ;;
> + --enable-split-debug) printf "%s" -Dsplit_debug=true ;;
> + --disable-split-debug) printf "%s" -Dsplit_debug=false ;;
> --sysconfdir=*) quote_sh "-Dsysconfdir=$2" ;;
> --enable-tcg) printf "%s" -Dtcg=enabled ;;
> --disable-tcg) printf "%s" -Dtcg=disabled ;;
> --
> 2.39.5
--
Alex Bennée
Virtualisation Tech Lead @ Linaro