Skip to content

main/rust: Add support for UEFI targets

Enable support for compiling for UEFI targets. This includes compiling binaries such as bootloaders, boot stubs (similar to gummiboot-efistub) and similar utilities.

This target is only supported by LLVM. GCC cannot produce native EFI binaries. When compiling for a UEFI target, GCC produces ELF binaries and uses GNU-EFI as a stub loader to run them inside EFI environments. This approach does not work when compiling Rust.

I had to disable optimized-compiler-builtins for this target. The profiler_builtins crate fails to build for the UEFI target; it is a C component which requires a UEFI specific sysroot to compile.

See: https://github.com/rust-lang/rust/pull/135326/

Edited by Hugo Barrera

Merge request reports

Loading