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