[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Should configure --enable-debug add -Og to CFLAGS?
From: |
Daniel P . Berrangé |
Subject: |
Re: [Qemu-devel] Should configure --enable-debug add -Og to CFLAGS? |
Date: |
Thu, 27 Jun 2019 17:02:18 +0100 |
User-agent: |
Mutt/1.11.4 (2019-03-13) |
On Thu, Jun 27, 2019 at 05:43:30PM +0200, Markus Armbruster wrote:
> The fine manual advises:
>
> '-O0'
> Reduce compilation time and make debugging produce the expected
> results. This is the default.
> [...]
> '-Og'
> Optimize debugging experience. '-Og' should be the optimization
> level of choice for the standard edit-compile-debug cycle, offering
> a reasonable level of optimization while maintaining fast
> compilation and a good debugging experience. It is a better choice
> than '-O0' for producing debuggable code because some compiler
> passes that collect debug information are disabled at '-O0'.
>
> Our configure --enable-debug effectively picks -O0. Should it pick -Og
> instead?
NB, it is the --enable-debug-info option to configure that actually
adds the "-g" flag for debug info in objects, and turns off -O2.
--enable-debug turns on TCG and Mutex debugging & disables fortify
source, but doesn't affect optimization level.
Adding -Og to --enable-debug-info would be problematic for Fedora/RHEL
distro builds, as we want debugging symbols, but also still want -O2
to be used.
Yes, the naming of these options is a trapdoor over a pit of crocodiles :-)
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 :|