Skip to content

Commit 3a9bf54

Browse files
yakuizhaojren1
authored andcommitted
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 <yakui.zhao@intel.com> Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent 52a91ff commit 3a9bf54

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

hypervisor/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ HV_FILE := acrn
2525
CFLAGS += -Wall -W
2626
CFLAGS += -ffunction-sections -fdata-sections
2727
CFLAGS += -fshort-wchar -ffreestanding
28-
CFLAGS += -m64
28+
CFLAGS += -m64 -mno-mmx -mno-sse -mno-sse2 -mno-80387 -mno-fp-ret-in-387
2929
CFLAGS += -mno-red-zone
3030
CFLAGS += -static -nostdinc -nostdlib -fno-common
3131
CFLAGS += -O0 -D_FORTIFY_SOURCE=2

hypervisor/bsp/uefi/efi/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ CFLAGS=-I. -I.. -I$(INCDIR)/efi -I$(INCDIR)/efi/$(ARCH) \
7070
-DEFI_FUNCTION_WRAPPER -fPIC -fshort-wchar -ffreestanding \
7171
-Wall -I../fs/ -D$(ARCH) -O0
7272

73+
CFLAGS += -mno-mmx -mno-sse -mno-sse2 -mno-80387 -mno-fp-ret-in-387
74+
7375
ifeq ($(ARCH),ia32)
7476
ifeq ($(HOST),x86_64)
7577
CFLAGS += -m32

0 commit comments

Comments
 (0)