All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4 04/14] x86: Tidy up selection of building the EFI stub
Date: Mon,  7 Nov 2016 08:47:06 -0700	[thread overview]
Message-ID: <1478533636-17577-5-git-send-email-sjg@chromium.org> (raw)
In-Reply-To: <1478533636-17577-1-git-send-email-sjg@chromium.org>

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
stub.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
---

Changes in v4: None
Changes in v3: None
Changes in v2:
- Add new patch to tidy up selection of building the EFI stub

 include/efi.h    | 7 +++++--
 lib/efi/Makefile | 4 ++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/include/efi.h b/include/efi.h
index d07187c..3d58780 100644
--- a/include/efi.h
+++ b/include/efi.h
@@ -30,8 +30,11 @@ struct efi_device_path;
 
 #define EFI_BITS_PER_LONG	BITS_PER_LONG
 
-/* With 64-bit EFI stub, EFI_BITS_PER_LONG has to be 64 */
-#ifdef CONFIG_EFI_STUB_64BIT
+/*
+ * 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)
 #undef EFI_BITS_PER_LONG
 #define EFI_BITS_PER_LONG	64
 #endif
diff --git a/lib/efi/Makefile b/lib/efi/Makefile
index e32dc14..9449600 100644
--- a/lib/efi/Makefile
+++ b/lib/efi/Makefile
@@ -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
-- 
2.8.0.rc3.226.g39d4020

  parent reply	other threads:[~2016-11-07 15:47 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-07 15:47 [U-Boot] [PATCH v4 00/14] efi: x86: Add EFI hello world and loader support for x86 Simon Glass
2016-11-07 15:47 ` [U-Boot] [PATCH v4 01/14] x86: Correct a build warning in x86 tables Simon Glass
2016-11-14 23:05   ` [U-Boot] [U-Boot, v4, " Alexander Graf
2016-11-07 15:47 ` [U-Boot] [PATCH v4 02/14] efi: Correct cache flush alignment Simon Glass
2016-11-14 23:06   ` [U-Boot] [U-Boot,v4,02/14] " Alexander Graf
2016-11-07 15:47 ` [U-Boot] [PATCH v4 03/14] efi: Fix debug message address format Simon Glass
2016-11-14 23:06   ` [U-Boot] [U-Boot, v4, " Alexander Graf
2016-11-07 15:47 ` Simon Glass [this message]
2016-11-14 23:05   ` [U-Boot] [U-Boot, v4, 04/14] x86: Tidy up selection of building the EFI stub Alexander Graf
2016-11-07 15:47 ` [U-Boot] [PATCH v4 05/14] efi: Makefile: Export variables for use with EFI Simon Glass
2016-11-14 23:06   ` [U-Boot] [U-Boot, v4, " Alexander Graf
2016-11-07 15:47 ` [U-Boot] [PATCH v4 06/14] efi: Add support for a hello world test program Simon Glass
2016-11-14 23:06   ` [U-Boot] [U-Boot, v4, " Alexander Graf
2016-11-07 15:47 ` [U-Boot] [PATCH v4 07/14] elf: arm: Add a few ARM relocation types Simon Glass
2016-11-14 23:06   ` [U-Boot] [U-Boot, v4, " Alexander Graf
2016-11-07 15:47 ` [U-Boot] [PATCH v4 08/14] efi: arm: Add EFI app support Simon Glass
2016-11-14 23:06   ` [U-Boot] [U-Boot,v4,08/14] " Alexander Graf
2016-11-07 15:47 ` [U-Boot] [PATCH v4 09/14] efi: arm: Add aarch64 " Simon Glass
2016-11-14 23:06   ` [U-Boot] [U-Boot, v4, " Alexander Graf
2016-11-07 15:47 ` [U-Boot] [PATCH v4 10/14] efi: arm: Enable the hello world test program Simon Glass
2016-11-07 15:47 ` [U-Boot] [PATCH v4 11/14] x86: Move efi .lds files into the 'lib' directory Simon Glass
2016-11-14 23:06   ` [U-Boot] [U-Boot, v4, " Alexander Graf
2016-11-07 15:47 ` [U-Boot] [PATCH v4 12/14] x86: Move efi .S " Simon Glass
2016-11-14 23:05   ` [U-Boot] [U-Boot, v4, " Alexander Graf
2016-11-07 15:47 ` [U-Boot] [PATCH v4 13/14] efi: x86: Adjust EFI files support efi_loader Simon Glass
2016-11-14 23:06   ` [U-Boot] [U-Boot, v4, " Alexander Graf
2016-11-07 15:47 ` [U-Boot] [PATCH v4 14/14] x86: Enable EFI loader support Simon Glass
2016-11-14 23:05   ` [U-Boot] [U-Boot,v4,14/14] " Alexander Graf
2016-11-14 21:39 ` [U-Boot] [PATCH v4 00/14] efi: x86: Add EFI hello world and loader support for x86 Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1478533636-17577-5-git-send-email-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.