[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Should configure --enable-debug add -Og to CFLAGS?
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] Should configure --enable-debug add -Og to CFLAGS? |
Date: |
Thu, 27 Jun 2019 18:45:02 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) |
Paolo Bonzini <address@hidden> writes:
> On 27/06/19 17:43, 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?
>>
>
> commit 48e56d503e18bd1e8a75463fd7cc1580bf7e7650
> Author: Paolo Bonzini <address@hidden>
> Date: Tue Mar 6 11:32:44 2018 +0100
>
> Revert "build-sys: compile with -Og or -O1 when --enable-debug"
>
> This reverts commit 906548689e37ab6cca1e93b3f8d9327a4e17e8af.
> Even with -Og, the debug experience is noticeably worse
> because gdb shows a lot more "<optimised out>" variables and
> function arguments.
>
> Signed-off-by: Paolo Bonzini <address@hidden>
>
> :(
Aha, GCC's documentation is more aspirational than factual here.
Nevermind!