Skip to contentSkip to conversation

optionrom: Turn off -fcf-protection

PATCH In review Björn Töpel 2 participants 2 messages Jan 3, 2022 – Jan 5, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 optionrom: Turn off -fcf-protection

Ubuntu GCC enables -fcf-protection globally, which is not supported for x86 16-bit (realmode). This causes the build to fail.

This commit turns off that option.

---
 pc-bios/optionrom/Makefile | 1 +
 1 file changed, 1 insertion(+)
pc-bios/optionrom/Makefile +1 -0
index 5d55d25acca2..c5f5fa02ef06 100644
@@ -21,6 +21,7 @@ override CFLAGS += $(filter -W%, $(QEMU_CFLAGS))
 override CFLAGS += $(CFLAGS_NOPIE) -ffreestanding -I$(TOPSRC_DIR)/include
 override CFLAGS += $(call cc-option, -fno-stack-protector)
 override CFLAGS += $(call cc-option, -m16)
+override CFLAGS += $(call cc-option, -fcf-protection=none)
 
 ifeq ($(filter -m16, $(CFLAGS)),)
 # Attempt to work around compilers that lack -m16 (GCC <= 4.8, clang <= ??)
Signature · 1 line
2.32.0
Reviewed-by on v1 1/1
#1 lore raw

CCing Paolo

Quoted 15 lines · Björn Töpel

Ubuntu GCC enables -fcf-protection globally, which is not supported for x86 16-bit (realmode). This causes the build to fail.

This commit turns off that option.

---
pc-bios/optionrom/Makefile | 1 +

1 file changed, 1 insertion(+)
pc-bios/optionrom/Makefile +0 -0
index 5d55d25acca2..c5f5fa02ef06 100644
@@ -21,6 +21,7 @@ override CFLAGS += $(filter -W%, $(QEMU_CFLAGS))
Quoted 4 lines

override CFLAGS += $(CFLAGS_NOPIE) -ffreestanding -I$(TOPSRC_DIR)/include override CFLAGS += $(call cc-option, -fno-stack-protector) override CFLAGS += $(call cc-option, -m16)
+override CFLAGS += $(call cc-option, -fcf-protection=none)

LGTM!