Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/48173 )
Change subject: HACK: src/commonlib/fsp_relocate: Fix compilation under x86_64 ......................................................................
HACK: src/commonlib/fsp_relocate: Fix compilation under x86_64
Change-Id: I0e3099fae1b70bfe9ec0abbdddb4231ab5e2f388 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/commonlib/fsp_relocate.c M src/vendorcode/intel/Makefile.inc M src/vendorcode/intel/edk2/UDK2015/MdePkg/Include/Ia32/ProcessorBind.h M src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Ia32/ProcessorBind.h 4 files changed, 27 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/73/48173/1
diff --git a/src/commonlib/fsp_relocate.c b/src/commonlib/fsp_relocate.c index 5d326b6..0e5556f 100644 --- a/src/commonlib/fsp_relocate.c +++ b/src/commonlib/fsp_relocate.c @@ -12,6 +12,8 @@
/* Default bind FSP 1.1 API to edk2 UEFI 2.4 types. */ #include <vendorcode/intel/edk2/uefi_2.4/uefi_types.h> +#define UINTN size_t + #include <vendorcode/intel/fsp/fsp1_1/IntelFspPkg/Include/FspInfoHeader.h>
/* Restore original packing policy. */ diff --git a/src/vendorcode/intel/Makefile.inc b/src/vendorcode/intel/Makefile.inc index 23ae587..3a8d491 100644 --- a/src/vendorcode/intel/Makefile.inc +++ b/src/vendorcode/intel/Makefile.inc @@ -6,18 +6,38 @@ # ProcessorBind.h isn't just about types. There's compiler definitions as well # as ABI enforcement. Luckily long is not used in Ia32/ProcessorBind.h for # a fixed width type. +ifeq ($(CONFIG_ARCH_ALL_STAGES_X86_32),y) CPPFLAGS_common += -I$(src)/vendorcode/intel/edk2/uefi_2.4/MdePkg/Include/Ia32 +endif +ifeq ($(CONFIG_ARCH_ALL_STAGES_X86_64),y) +CPPFLAGS_common += -I$(src)/vendorcode/intel/edk2/uefi_2.4/MdePkg/Include/X64 +endif CPPFLAGS_common += -I$(src)/vendorcode/intel/edk2/uefi_2.4/MdePkg/Include else ifeq ($(CONFIG_UDK_2015_BINDING),y) +ifeq ($(CONFIG_ARCH_ALL_STAGES_X86_32),y) CPPFLAGS_common += -I$(src)/vendorcode/intel/edk2/UDK2015/MdePkg/Include/Ia32 +endif +ifeq ($(CONFIG_ARCH_ALL_STAGES_X86_64),y) +CPPFLAGS_common += -I$(src)/vendorcode/intel/edk2/UDK2015/MdePkg/Include/X64 +endif CPPFLAGS_common += -I$(src)/vendorcode/intel/edk2/UDK2015/MdePkg/Include CPPFLAGS_common += -I$(src)/vendorcode/intel/edk2/UDK2015/IntelFsp2Pkg/Include else ifeq ($(CONFIG_UDK_2017_BINDING),y) +ifeq ($(CONFIG_ARCH_ALL_STAGES_X86_32),y) CPPFLAGS_common += -I$(src)/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Ia32 +endif +ifeq ($(CONFIG_ARCH_ALL_STAGES_X86_64),y) +CPPFLAGS_common += -I$(src)/vendorcode/intel/edk2/UDK2017/MdePkg/Include/X64 +endif CPPFLAGS_common += -I$(src)/vendorcode/intel/edk2/UDK2017/MdePkg/Include CPPFLAGS_common += -I$(src)/vendorcode/intel/edk2/UDK2017/IntelFsp2Pkg/Include else ifeq ($(CONFIG_UDK_202005_BINDING),y) +ifeq ($(CONFIG_ARCH_ALL_STAGES_X86_32),y) CPPFLAGS_common += -I$(src)/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Ia32 +endif +ifeq ($(CONFIG_ARCH_ALL_STAGES_X86_64),y) +CPPFLAGS_common += -I$(src)/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/X64 +endif CPPFLAGS_common += -I$(src)/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include CPPFLAGS_common += -I$(src)/vendorcode/intel/edk2/edk2-stable202005/IntelFsp2Pkg/Include endif diff --git a/src/vendorcode/intel/edk2/UDK2015/MdePkg/Include/Ia32/ProcessorBind.h b/src/vendorcode/intel/edk2/UDK2015/MdePkg/Include/Ia32/ProcessorBind.h index 2f77042..0394e02 100644 --- a/src/vendorcode/intel/edk2/UDK2015/MdePkg/Include/Ia32/ProcessorBind.h +++ b/src/vendorcode/intel/edk2/UDK2015/MdePkg/Include/Ia32/ProcessorBind.h @@ -275,7 +275,7 @@ /// /// GCC specific method for EFIAPI calling convention. /// - #define EFIAPI __attribute__((cdecl)) + #define EFIAPI #else /// /// The default for a non Microsoft* or GCC compiler is to assume the EFI ABI diff --git a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Ia32/ProcessorBind.h b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Ia32/ProcessorBind.h index 69eba65..5d3ed0c 100644 --- a/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Ia32/ProcessorBind.h +++ b/src/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Ia32/ProcessorBind.h @@ -278,11 +278,15 @@ /// #define EFIAPI __cdecl #elif defined(__GNUC__) +#ifndef __x86_64__ /// /// GCC specific method for EFIAPI calling convention. /// #define EFIAPI __attribute__((cdecl)) #else + #define EFIAPI +#endif +#else /// /// The default for a non Microsoft* or GCC compiler is to assume the EFI ABI /// is the standard.