From: Thomas Huth <thuth@redhat.com>
To: christian.ehrhardt@canonical.com,
qemu-devel <qemu-devel@nongnu.org>,
Paolo Bonzini <pbonzini@redhat.com>
Cc: QEMU Trivial <qemu-trivial@nongnu.org>,
qemu-stable@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH] build: disable fcf-protection on -march=486 -m16
Date: Wed, 23 Mar 2022 10:45:01 +0100 [thread overview]
Message-ID: <649c2c79-9d64-f44b-f801-492f47606794@redhat.com> (raw)
In-Reply-To: <20220323090713.1002588-1-christian.ehrhardt@canonical.com>
On 23/03/2022 10.07, christian.ehrhardt@canonical.com wrote:
> From: Christian Ehrhardt <christian.ehrhardt@canonical.com>
>
> Some of the roms build with -march=i486 -m16 which is incompatible
> with -fcf-protection. That in turn is can be set by default, for
> example in Ubuntu [1].
> That causes:
> cc1: error: ‘-fcf-protection’ is not compatible with this target
>
> This won't work on -march=i486 -m16 and no matter if set or not we can
> override it to "none" if the option is known to the compiler to be
> able to build reliably.
>
> Fixes: https://gitlab.com/qemu-project/qemu/-/issues/889
>
> [1]: https://wiki.ubuntu.com/ToolChain/CompilerFlags#A-fcf-protection
>
> Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
> ---
> pc-bios/optionrom/Makefile | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile
> index 5d55d25acc..f1ef898073 100644
> --- a/pc-bios/optionrom/Makefile
> +++ b/pc-bios/optionrom/Makefile
> @@ -14,6 +14,10 @@ cc-option = $(if $(shell $(CC) $1 -c -o /dev/null -xc /dev/null >/dev/null 2>&1
>
> override CFLAGS += -march=i486 -Wall
>
> +# If -fcf-protection is enabled in flags or compiler defaults that will
> +# conflict with -march=i486
> +override CFLAGS += $(call cc-option, -fcf-protection=none)
> +
> # Flags for dependency generation
> override CPPFLAGS += -MMD -MP -MT $@ -MF $(@D)/$(*F).d
>
Reviewed-by: Thomas Huth <thuth@redhat.com>
next prev parent reply other threads:[~2022-03-23 9:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-23 9:07 [PATCH] build: disable fcf-protection on -march=486 -m16 christian.ehrhardt
2022-03-23 9:45 ` Thomas Huth [this message]
2022-03-23 10:54 ` [PATCH-for-7.0] " Philippe Mathieu-Daudé
2022-03-24 8:26 ` Christian Ehrhardt
2022-03-24 17:44 ` [PATCH] " Paolo Bonzini
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=649c2c79-9d64-f44b-f801-492f47606794@redhat.com \
--to=thuth@redhat.com \
--cc=christian.ehrhardt@canonical.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
--cc=qemu-trivial@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).