Right now the "zefi" EFI loader is a standalone script that processes a zephyr.elf file into a loadable zephyr.efi file. That is helpful for testing and early development, but it has some drawbacks. Ideally we want the build process for EFI binaries to work the way it does on other platforms and be a first class output of the cmake build system. Some general requirements:
[x] It should build with the same x86_64 toolchain that Zephyr does, and not the host toolchain (#27047)
[ ] It should have access to devicetree and kconfig symbols via the same headers and include directories
[ ] Zephyr's build should be able to know if it is in "EFI" mode to better optimize some areas (e.g. PCIE_MMIO, or the needless multiboot code)
[x] Zephyr should have access to the EFI system table (and maybe the API, though the ABI is different for those functions) at runtime - Implemented by #26737
Right now the "zefi" EFI loader is a standalone script that processes a zephyr.elf file into a loadable zephyr.efi file. That is helpful for testing and early development, but it has some drawbacks. Ideally we want the build process for EFI binaries to work the way it does on other platforms and be a first class output of the cmake build system. Some general requirements: