summaryrefslogtreecommitdiff
path: root/arch/x86/config.mk
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/config.mk')
-rw-r--r--arch/x86/config.mk10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/x86/config.mk b/arch/x86/config.mk
index 334c10b..d7addd8 100644
--- a/arch/x86/config.mk
+++ b/arch/x86/config.mk
@@ -34,14 +34,24 @@ OBJCOPYFLAGS_EFI := -j .text -j .sdata -j .data -j .dynamic -j .dynsym \
CFLAGS_NON_EFI := -mregparm=3
CFLAGS_EFI := -fpic -fshort-wchar
+ifeq ($(CONFIG_EFI_STUB_64BIT),)
+CFLAGS_EFI += $(call cc-option, -mno-red-zone)
EFIARCH = ia32
EFIPAYLOAD_BFDTARGET = elf32-i386
+else
+EFIARCH = x86_64
+EFIPAYLOAD_BFDTARGET = elf64-x86-64
+endif
EFIPAYLOAD_BFDARCH = i386
LDSCRIPT_EFI := $(srctree)/$(CPUDIR)/efi/elf_$(EFIARCH)_efi.lds
+EFISTUB := crt0-efi-$(EFIARCH).o reloc_$(EFIARCH).o
OBJCOPYFLAGS_EFI += --target=efi-app-$(EFIARCH)
+CPPFLAGS_REMOVE_crt0-efi-$(EFIARCH).o += $(CFLAGS_NON_EFI)
+CPPFLAGS_crt0-efi-$(EFIARCH).o += $(CFLAGS_EFI)
+
ifeq ($(CONFIG_EFI_APP),y)
PLATFORM_CPPFLAGS += $(CFLAGS_EFI)