On Tue, Mar 04, 2025 at 11:33:44AM +0000, Alex Bennée wrote:
> Daniel P. Berrangé <berra...@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/de...@lists.fedoraproject.org/thread/RXA55BTO62NWWHCTUFYGEVHJKZPL5EKE/

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 :|


Reply via email to