From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: John Snow <jsnow@redhat.com>,
QEMU Developers <qemu-devel@nongnu.org>,
Patch Tracking <patches@linaro.org>
Subject: Re: [Qemu-devel] [PATCH for-2.5] configure: Don't disable optimization for non-fortify builds
Date: Mon, 9 Nov 2015 16:33:35 +0100 [thread overview]
Message-ID: <5640BCCF.30507@redhat.com> (raw)
In-Reply-To: <CAFEAcA-dkuA2k0Pw8MLRc8u13urPuAbQCpF90xMZOY38EPkkFQ@mail.gmail.com>
On 09/11/2015 16:31, Peter Maydell wrote:
> On 9 November 2015 at 15:28, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>
>>
>> On 09/11/2015 16:14, Peter Maydell wrote:
>>> Commit b553a0428014636bc inadvertently disabled optimization
>>> for all non-fortify builds. Fix this bug so we only do an
>>> unoptimized build if we want debug.
>>>
>>> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
>>> ---
>>> configure | 2 ++
>>> 1 file changed, 2 insertions(+)
>>>
>>> diff --git a/configure b/configure
>>> index b687764..46fd8bd 100755
>>> --- a/configure
>>> +++ b/configure
>>> @@ -4451,6 +4451,8 @@ if test "$gcov" = "yes" ; then
>>> LDFLAGS="-fprofile-arcs -ftest-coverage $LDFLAGS"
>>> elif test "$fortify_source" = "yes" ; then
>>> CFLAGS="-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS"
>>> +elif test "$debug" = "no"; then
>>> + CFLAGS="-O2 $CFLAGS"
>>> fi
>>
>> I think what was intended is:
>>
>> if test "$gcov" = "yes" ; then
>> CFLAGS="-fprofile-arcs -ftest-coverage -g $CFLAGS"
>> LDFLAGS="-fprofile-arcs -ftest-coverage $LDFLAGS"
>> elif test "$debug" = "no" ; then
>> if test "$fortify_source" = "yes"; then
>> CFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS"
>> fi
>> CFLAGS="-O2 $CFLAGS"
>> fi
>>
>> ... so that --enable-debug does not disable _FORTIFY_SOURCE.
>
> Commit b553a04280146 specifically sets fortify_source=no
> in the handling of the --enable-debug option, so John
> obviously intended that it should disable _FORTIFY_SOURCE.
> The feature_test_macros(7) manpage says _FORTIFY_SOURCE
> only kicks in at -O1 and above anyway, so that makes sense.
You're right. The two are the same then, preference is of course
subjective. Feel free to commit yours!
Paolo
next prev parent reply other threads:[~2015-11-09 15:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-09 15:14 [Qemu-devel] [PATCH for-2.5] configure: Don't disable optimization for non-fortify builds Peter Maydell
2015-11-09 15:28 ` Paolo Bonzini
2015-11-09 15:31 ` Peter Maydell
2015-11-09 15:33 ` Paolo Bonzini [this message]
2015-11-09 16:58 ` Peter Maydell
2015-11-12 15:30 ` Laurent Vivier
2015-11-09 22:14 ` Eric Blake
2015-11-09 16:38 ` John Snow
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=5640BCCF.30507@redhat.com \
--to=pbonzini@redhat.com \
--cc=jsnow@redhat.com \
--cc=patches@linaro.org \
--cc=peter.maydell@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).