diff --git a/src/system/boot/arch/x86/Jamfile b/src/system/boot/arch/x86/Jamfile index 1a4f30cbcf..1f90ef1a3e 100644 --- a/src/system/boot/arch/x86/Jamfile +++ b/src/system/boot/arch/x86/Jamfile @@ -1,10 +1,24 @@ SubDir HAIKU_TOP src system boot arch x86 ; +local defines = $(DEFINES) ; + local platform ; for platform in [ MultiBootSubDirSetup bios_ia32 efi pxe_ia32 ] { on $(platform) { + DEFINES = $(defines) ; DEFINES += _BOOT_MODE ; + if $(TARGET_BOOT_PLATFORM) = efi { + if $(TARGET_ARCH) = x86_64 { + DEFINES += BOOT_SUPPORT_ELF64 ; + } else { + DEFINES += BOOT_SUPPORT_ELF32 ; + } + } else { + DEFINES += BOOT_SUPPORT_ELF64 ; + DEFINES += BOOT_SUPPORT_ELF32 ; + } + local kernelArchSources = arch_elf.cpp ; diff --git a/src/system/kernel/arch/x86/arch_elf.cpp b/src/system/kernel/arch/x86/arch_elf.cpp index cb1d0f2363..7e991137d3 100644 --- a/src/system/kernel/arch/x86/arch_elf.cpp +++ b/src/system/kernel/arch/x86/arch_elf.cpp @@ -184,10 +184,12 @@ arch_elf_relocate_rela(struct elf_image_info *image, } -#endif // !__x86_64__ || defined(ELF32_COMPAT) || (_BOOT_MODE && _BOOT_PLATFORM != efi) +#endif // !defined(__x86_64__) || defined(ELF32_COMPAT) || + // (defined(_BOOT_MODE) && _BOOT_PLATFORM != efi) -#if (defined(__x86_64__) && !defined(ELF32_COMPAT)) || defined(_BOOT_MODE) +#if (defined(__x86_64__) && !defined(ELF32_COMPAT)) || \ + (defined(_BOOT_MODE) && defined(BOOT_SUPPORT_ELF64)) #ifdef _BOOT_MODE @@ -280,4 +282,5 @@ arch_elf_relocate_rela(struct elf_image_info *image, } -#endif // (defined(__x86_64__) && !defined(ELF32_COMPAT)) || defined(_BOOT_MODE) +#endif // (defined(__x86_64__) && !defined(ELF32_COMPAT)) || + // (defined(_BOOT_MODE) && defined(BOOT_SUPPORT_ELF64))