From: Stefan Hajnoczi <stefanha@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: qemu-devel@nongnu.org, "Alex Bennée" <alex.bennee@linaro.org>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Kevin Wolf" <kwolf@redhat.com>, "Thomas Huth" <thuth@redhat.com>
Subject: Re: [PATCH RESEND] osdep: set _FORTIFY_SOURCE=2 when optimization is enabled
Date: Tue, 3 Oct 2023 13:35:40 -0400 [thread overview]
Message-ID: <20231003173540.GA1133503@fedora> (raw)
In-Reply-To: <20231003091549.223020-1-berrange@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1402 bytes --]
On Tue, Oct 03, 2023 at 10:15:49AM +0100, Daniel P. Berrangé wrote:
> Currently we set _FORTIFY_SOURCE=2 as a compiler argument when the
> meson 'optimization' setting is non-zero, the compiler is GCC and
> the target is Linux.
>
> While the default QEMU optimization level is 2, user could override
> this by setting CFLAGS="-O0" or --extra-cflags="-O0" when running
> configure and this won't be reflected in the meson 'optimization'
> setting. As a result we try to enable _FORTIFY_SOURCE=2 and then the
> user gets compile errors as it only works with optimization.
>
> Rather than trying to improve detection in meson, it is simpler to
> just check the __OPTIMIZE__ define from osdep.h.
>
> The comment about being incompatible with clang appears to be
> outdated, as compilation works fine without excluding clang.
>
> In the coroutine code we must set _FORTIFY_SOURCE=0 to stop the
> logic in osdep.h then enabling it.
>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>
> Re-sent due to previous bad patch submission
>
> include/qemu/osdep.h | 4 ++++
> meson.build | 10 ----------
> util/coroutine-sigaltstack.c | 4 ++--
> util/coroutine-ucontext.c | 4 ++--
> 4 files changed, 8 insertions(+), 14 deletions(-)
Thanks, applied to my block tree:
https://gitlab.com/stefanha/qemu/commits/block
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
prev parent reply other threads:[~2023-10-03 17:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-03 9:15 [PATCH RESEND] osdep: set _FORTIFY_SOURCE=2 when optimization is enabled Daniel P. Berrangé
2023-10-03 14:03 ` Richard Henderson
2023-10-03 17:35 ` Stefan Hajnoczi [this message]
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=20231003173540.GA1133503@fedora \
--to=stefanha@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=berrange@redhat.com \
--cc=kwolf@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/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).