summaryrefslogtreecommitdiffstats
path: root/src/Makefile.housekeeping
diff options
context:
space:
mode:
authorGeoff Lywood2010-07-21 04:23:02 +0200
committerMichael Brown2010-07-21 13:41:41 +0200
commitb8dd94686bf452292163763687d11cdea5c723b1 (patch)
treeca8a68a8796af32f088886724dac6499296d89ba /src/Makefile.housekeeping
parent[tcp] Allow out-of-order receive queue to be discarded (diff)
downloadipxe-b8dd94686bf452292163763687d11cdea5c723b1.tar.gz
ipxe-b8dd94686bf452292163763687d11cdea5c723b1.tar.xz
ipxe-b8dd94686bf452292163763687d11cdea5c723b1.zip
[efi] Fix the 32-bit version of elf2efi64
Currently, if elf2efi.c is compiled using a 32-bit HOST_CC, then the resulting elf2efi64 binary will generate 32-bit EFI binaries instead of 64-bit EFI binaries. The problem is that elf2efi.c uses the MDE_CPU_* definitions to decide whether to output a 32-bit or 64-bit PE binary. However, MDE_CPU_* gets defined in ProcessorBind.h, depending on the compiler's target architecture. Overriding them on the command line doesn't work in the expected way, and you can end up in cases where both MDE_CPU_IA32 and MDE_CPU_X64 are defined. Fix by using a separate definition, EFI_TARGET_IA32/EFI_TARGET_X64, which is specified only on the command line. Signed-off-by: Geoff Lywood <glywood@vmware.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/Makefile.housekeeping')
-rw-r--r--src/Makefile.housekeeping4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping
index 6da75178..7278c283 100644
--- a/src/Makefile.housekeeping
+++ b/src/Makefile.housekeeping
@@ -907,12 +907,12 @@ ELF2EFI_CFLAGS := -I$(BINUTILS_DIR)/include -I$(BFD_DIR)/include \
$(ELF2EFI32) : util/elf2efi.c $(MAKEDEPS)
$(QM)$(ECHO) " [HOSTCC] $@"
- $(Q)$(HOST_CC) $< $(ELF2EFI_CFLAGS) -DMDE_CPU_IA32 -O2 -o $@
+ $(Q)$(HOST_CC) $< $(ELF2EFI_CFLAGS) -DEFI_TARGET_IA32 -O2 -o $@
CLEANUP += $(ELF2EFI32)
$(ELF2EFI64) : util/elf2efi.c $(MAKEDEPS)
$(QM)$(ECHO) " [HOSTCC] $@"
- $(Q)$(HOST_CC) $< $(ELF2EFI_CFLAGS) -DMDE_CPU_X64 -O2 -o $@
+ $(Q)$(HOST_CC) $< $(ELF2EFI_CFLAGS) -DEFI_TARGET_X64 -O2 -o $@
CLEANUP += $(ELF2EFI64)
$(EFIROM) : util/efirom.c $(MAKEDEPS)