Commit 5abd9137 authored by Simon Glass's avatar Simon Glass Committed by Alexander Graf

x86: Tidy up selection of building the EFI stub

At present we use a CONFIG option in efi.h to determine whether we are
building the EFI stub or not. This means that the same header cannot be
used for EFI_LOADER support. The CONFIG option will be enabled for the
whole build, even when not building the stub.

Use a different define instead, set up just for the files that make up the
Signed-off-by: default avatarSimon Glass <>
Reviewed-by: default avatarBin Meng <>
Signed-off-by: default avatarAlexander Graf <>
parent 5ee31baf
......@@ -30,8 +30,11 @@ struct efi_device_path;
/* With 64-bit EFI stub, EFI_BITS_PER_LONG has to be 64 */
* With 64-bit EFI stub, EFI_BITS_PER_LONG has to be 64. EFI_STUB is set
* in lib/efi/Makefile, when building the stub.
#if defined(CONFIG_EFI_STUB_64BIT) && defined(EFI_STUB)
#define EFI_BITS_PER_LONG 64
......@@ -9,9 +9,9 @@ obj-$(CONFIG_EFI_STUB) += efi_info.o
CFLAGS_REMOVE_efi_stub.o := -mregparm=3 \
$(if $(CONFIG_EFI_STUB_64BIT),-march=i386 -m32)
CFLAGS_efi_stub.o := -fpic -fshort-wchar
CFLAGS_efi_stub.o := -fpic -fshort-wchar -DEFI_STUB
CFLAGS_REMOVE_efi.o := -mregparm=3 \
$(if $(CONFIG_EFI_STUB_64BIT),-march=i386 -m32)
CFLAGS_efi.o := -fpic -fshort-wchar
CFLAGS_efi.o := -fpic -fshort-wchar -DEFI_STUB
extra-$(CONFIG_EFI_STUB) += efi_stub.o efi.o
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment