From fda00e6cd78a198269b597a9042d11b3c0f07596 Mon Sep 17 00:00:00 2001 From: Zhao Yakui Date: Thu, 10 May 2018 11:14:09 +0800 Subject: [PATCH] HV: Add gcc compiler option to disable FPU/SSE/MMX FPU/SSE is not supported in HV. Otherwise it is possible that the SSE/FPU register is used under -O2 option. So the gcc option is added to disable them. Signed-off-by: Zhao Yakui Reviewed-by: Jason Chen CJ Acked-by: Anthony Xu Acked-by: Eddie Dong --- hypervisor/Makefile | 2 +- hypervisor/bsp/uefi/efi/Makefile | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/hypervisor/Makefile b/hypervisor/Makefile index ad64608e2..d2bd682a2 100644 --- a/hypervisor/Makefile +++ b/hypervisor/Makefile @@ -25,7 +25,7 @@ HV_FILE := acrn CFLAGS += -Wall -W CFLAGS += -ffunction-sections -fdata-sections CFLAGS += -fshort-wchar -ffreestanding -CFLAGS += -m64 +CFLAGS += -m64 -mno-mmx -mno-sse -mno-sse2 -mno-80387 -mno-fp-ret-in-387 CFLAGS += -mno-red-zone CFLAGS += -static -nostdinc -nostdlib -fno-common CFLAGS += -O0 -D_FORTIFY_SOURCE=2 diff --git a/hypervisor/bsp/uefi/efi/Makefile b/hypervisor/bsp/uefi/efi/Makefile index 520f01875..241870325 100644 --- a/hypervisor/bsp/uefi/efi/Makefile +++ b/hypervisor/bsp/uefi/efi/Makefile @@ -70,6 +70,8 @@ CFLAGS=-I. -I.. -I$(INCDIR)/efi -I$(INCDIR)/efi/$(ARCH) \ -DEFI_FUNCTION_WRAPPER -fPIC -fshort-wchar -ffreestanding \ -Wall -I../fs/ -D$(ARCH) -O0 +CFLAGS += -mno-mmx -mno-sse -mno-sse2 -mno-80387 -mno-fp-ret-in-387 + ifeq ($(ARCH),ia32) ifeq ($(HOST),x86_64) CFLAGS += -m32