From: "Daniel P. Berrangé" <berrange@redhat.com>
To: "Alex Bennée" <alex.bennee@linaro.org>,
qemu-devel@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [RFC PATCH] meson.build: add -gsplit-dwarf to default cflags
Date: Tue, 4 Mar 2025 13:20:01 +0000 [thread overview]
Message-ID: <Z8b96wVB2f88csSN@redhat.com> (raw)
In-Reply-To: <Z8bt7ajRVwdabG7p@redhat.com>
On Tue, Mar 04, 2025 at 12:11:25PM +0000, Daniel P. Berrangé wrote:
> On Tue, Mar 04, 2025 at 11:33:44AM +0000, Alex Bennée wrote:
> > Daniel P. Berrangé <berrange@redhat.com> writes:
> >
> > > On Mon, Mar 03, 2025 at 10:17:03PM +0000, Alex Bennée wrote:
> > >> This option is supported by both gcc (since 4.7) and clang (since
> > >> 7.0). Not only does this make the linkers job easier by reducing the
> > >> amount of ELF it needs to parse it also reduces the total build size
> > >> quite considerably. In my case a default build went from 5.8G to 3.9G.
> > >
> > > I've not come across this option before, but the docs say
> > >
> > > ‘-gsplit-dwarf’
> > > If DWARF debugging information is enabled, separate as much
> > > debugging information as possible into a separate output file with
> > > the extension ‘.dwo’. This option allows the build system to avoid
> > > linking files with debug information. To be useful, this option
> > > requires a debugger capable of reading ‘.dwo’ files.
> > >
> > > In Fedora and RHEL we build QEMU will full debug enabled, and then a feature
> > > of the distro RPM build config will post-process all ELF files to extract
> > > the debug info into files that we store under /usr/lib/debug. eg for
> > > /usr/bin/qemu-system-x86_64, we get a separate
> > > /usr/lib/debug/bin/qemu-system-x86_64-9.1.3-1.fc41.x86_64.debug, and
> > > tools like GDB, etc know to look for these separate files.
> >
> > A modern gdb can certainly handle fetching the debug out of the .dwo
> > files when debugging.
>
> See this response from one of the upstream GCC maintainers pretty much
> recommending against (on by default) use of -gsplit-dwarf:
>
> https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/RXA55BTO62NWWHCTUFYGEVHJKZPL5EKE/
Since lists.fp.o is being rather unreliable today...
[quote]
On Tue, Mar 04, 2025 at 11:44:18AM +0000, Daniel P. Berrangé wrote:
> The QEMU community is discussing possible use of -gsplit-dwarf as a default
> option for QEMU's build system:
>
> https://lists.nongnu.org/archive/html/qemu-devel/2025-03/msg00424.html
>
> This option causes debug symbols to be written to separate .dwo files
> instead of the .o files or final executables.
Don't.
-gsplit-dwarf is something to get faster link times at the expense of slower
debugging and more files around.
So, it can be useful for fast modify/rebuild/test cycles during development,
but is something that is really undesirable for the distro builds.
There you don't mind slightly longer link times, that is done once per
build, but having to ship larger debug info and especially when it is split
into hundreds or thousands of small files is then a price everybody who
downloads the package debuginfo pays.
debugedit can't deal with it, dwz can't either, in order to ship something
reasonable one would need to dwp the separate debug info back into the
normal debug info.
Jakub
[/quote]
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2025-03-04 13:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-03 22:17 [RFC PATCH] meson.build: add -gsplit-dwarf to default cflags Alex Bennée
2025-03-04 10:19 ` Daniel P. Berrangé
2025-03-04 11:33 ` Alex Bennée
2025-03-04 11:38 ` Daniel P. Berrangé
2025-03-04 12:11 ` Daniel P. Berrangé
2025-03-04 13:20 ` Daniel P. Berrangé [this message]
2025-03-04 13:47 ` Alex Bennée
2025-03-04 13:40 ` Philippe Mathieu-Daudé
2025-03-04 13:43 ` Daniel P. Berrangé
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=Z8b96wVB2f88csSN@redhat.com \
--to=berrange@redhat.com \
--cc=alex.bennee@linaro.org \
--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).