]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[efi] Build util/efirom as a host-only binary
authorMichael Brown <mcb30@ipxe.org>
Sat, 28 Jan 2023 16:24:05 +0000 (16:24 +0000)
committerMichael Brown <mcb30@ipxe.org>
Sat, 28 Jan 2023 16:26:28 +0000 (16:26 +0000)
As with util/elf2efi32 and util/elf2efi64 in commit a99e435 ("[efi] Do
not rely on ProcessorBind.h when building host binaries"), build
util/efirom without using any architecture-specific EDK2 headers since
the build host's CPU architecture may not be supported by EDK2.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/include/ipxe/efi/ProcessorBind.h
src/util/efirom.c

index eda609b9453256817767961635527592e5aa0e88..8cc04e15be37af2d42a439a8dda446fbe5cc1714 100644 (file)
@@ -40,6 +40,9 @@ typedef uint8_t BOOLEAN;
 /* Define an architecture-neutral MDE_CPU macro to prevent build errors */
 #define MDE_CPU_EBC
 
+/* Define MAX_BIT in terms of UINTN */
+#define MAX_BIT ( ( ( UINTN ) 1U ) << ( ( 8 * sizeof ( UINTN ) ) - 1 ) )
+
 #else /* EFI_HOSTONLY */
 
 #ifdef __i386__
index 95feaf239540723315fe7eed69e9868753d6736c..8ac7966efa07e6b1fd908a24adb47c47b1c031b7 100644 (file)
@@ -28,6 +28,8 @@
 #include <errno.h>
 #include <assert.h>
 #include <getopt.h>
+
+#define EFI_HOSTONLY
 #include <ipxe/efi/Uefi.h>
 #include <ipxe/efi/IndustryStandard/PeImage.h>
 #include <ipxe/efi/IndustryStandard/Pci22.h>