[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 7/7] build: disable fcf-protection on -march=486 -m16
From: |
Paolo Bonzini |
Subject: |
[PULL 7/7] build: disable fcf-protection on -march=486 -m16 |
Date: |
Fri, 25 Mar 2022 08:07:06 +0100 |
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>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20220323090713.1002588-1-christian.ehrhardt@canonical.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.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
--
2.35.1
- [PULL 0/7] (Mostly) x86 fixes for QEMU 7.0.0-rc2, Paolo Bonzini, 2022/03/25
- [PULL 3/7] KVM: x86: workaround invalid CPUID[0xD, 9] info on some AMD processors, Paolo Bonzini, 2022/03/25
- [PULL 2/7] i386: Set MCG_STATUS_RIPV bit for mce SRAR error, Paolo Bonzini, 2022/03/25
- [PULL 1/7] target/i386/kvm: Free xsave_buf when destroying vCPU, Paolo Bonzini, 2022/03/25
- [PULL 7/7] build: disable fcf-protection on -march=486 -m16,
Paolo Bonzini <=
- [PULL 4/7] configure: remove dead int128 test, Paolo Bonzini, 2022/03/25
- [PULL 6/7] target/i386: properly reset TSC on reset, Paolo Bonzini, 2022/03/25
- [PULL 5/7] target/i386: tcg: high bits SSE cmp operation must be ignored, Paolo Bonzini, 2022/03/25
- Re: [PULL 0/7] (Mostly) x86 fixes for QEMU 7.0.0-rc2, Peter Maydell, 2022/03/25