qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel <qemu-devel@nongnu.org>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [PATCH v2] meson.build: default to -gsplit-dwarf for debug info
Date: Thu, 06 Mar 2025 14:42:52 +0000	[thread overview]
Message-ID: <87tt862par.fsf@draig.linaro.org> (raw)
In-Reply-To: <CABgObfbJz3ctqJ=pidb=gRxspwfnXMY9dtD0QYSwcjP6A-BQJw@mail.gmail.com> (Paolo Bonzini's message of "Thu, 6 Mar 2025 14:38:59 +0100")

Paolo Bonzini <pbonzini@redhat.com> writes:

> Il gio 6 mar 2025, 13:20 Alex Bennée <alex.bennee@linaro.org> ha scritto:
>
>  Paolo Bonzini <pbonzini@redhat.com> writes:
>
>  > Il gio 6 mar 2025, 11:53 Alex Bennée <alex.bennee@linaro.org> 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 am not sure what you mean by optimization field; anyway, qemu_cflags applies to all C sources and qemu_ldflags to all
> programs linked with the C compiler. As I understand it,
> '-gsplit-dwarf' should go in qemu_cflags.


if get_option('optimization') != 'plain'
  option_cflags += ['-O' + get_option('optimization')]
endif

Are you saying this is never applied to the build?


>
> Paolo 
>
>  >
>  > (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

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro


      reply	other threads:[~2025-03-06 14:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-06 10:53 [PATCH v2] meson.build: default to -gsplit-dwarf for debug info Alex Bennée
2025-03-06 10:57 ` Daniel P. Berrangé
2025-03-06 11:36 ` Paolo Bonzini
2025-03-06 12:20   ` Alex Bennée
2025-03-06 13:38     ` Paolo Bonzini
2025-03-06 14:42       ` Alex Bennée [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tt862par.fsf@draig.linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=berrange@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).