UEFI EDK II Build Tools and Toolchains
This article provides an overview of the essential build tools, compilers, assemblers, and utilities integrated into the UEFI EDK II (TianoCore) development environment. It details the primary C/C++ toolchains, assembly processors, ACPI compilers, and native EDK II BaseTools required to compile, link, and package UEFI firmware images across diverse hardware architectures.
Primary C/C++ Compilers and Linkers
EDK II supports several cross-platform and vendor-specific toolchains
defined in its configuration files (notably tools_def.txt).
The build system abstracts compiler differences via standardized tool
tags:
- GCC (GNU Compiler Collection): Extensively used on
Linux environments for x86, x64, ARM, AArch64, and RISC-V targets. EDK
II uses tool tags such as
GCC5to invokegccfor compilation andld(orgccas a linker driver) along withobjcopyto produce PE32/PE32+ binaries. - Microsoft Visual C++ (MSVC): The default toolchain
for Windows development environments. Tags such as
VS2019andVS2022invokecl.exefor compilation andlink.exefor linking PE/COFF images natively. - Clang/LLVM: Supported via tool tags like
CLANG38andCLANGPDB. Clang is used as an alternative to GCC and MSVC, often leveraginglld-linkto generate PDB debug formats across platforms.
Assemblers
Because UEFI firmware directly initializes processor states, specific assemblers are required for low-level architecture initialization:
- NASM (Netwide Assembler): The mandatory assembler
for IA-32 (x86) and x64 assembly source files (
.nasm). NASM replaced earlier dependencies on platform-specific assemblers to ensure consistent cross-platform builds between Windows and Linux. - MASM (Microsoft Macro Assembler): Invoked via
ml.exe(32-bit) andml64.exe(64-bit) when compiling under older or specific MSVC configurations, though largely supplanted by NASM in modern EDK II packages. - GNU as (GAS): Utilized primarily for ARM, AArch64,
and RISC-V architectures when targeting GCC toolchains to compile
.Sfiles.
ACPI Compiler (iASL)
- Intel ASL Compiler (iASL): A core requirement for
firmware projects that implement ACPI. EDK II invokes
iaslto compile ACPI Source Language (.asl) files into translated ACPI Machine Language (.aml) byte code, which is then embedded into firmware volumes.
EDK II BaseTools
EDK II contains a custom suite of internal tools, collectively referred to as BaseTools, to handle firmware-specific packaging:
- Python: Modern BaseTools rely on Python 3 for build
dispatching, target configuration parsing (
target.txt), platform description file parsing (.dsc,.dec,.inf), and dependency tracking through the centralbuildcommand. - C-based BaseTools: A set of native C binaries
compiled during workspace setup:
- GenFv: Generates Firmware Volume (FV) images from compiled PEIMs and DXE drivers.
- GenFds: Produces the final Firmware Device (FD)
binary image based on the Flash Description (
.fdf) file. - GenSec: Packages binaries into standard UEFI encapsulation sections (e.g., compression, guided sections, UI strings).
- DevicePath / VolInfo: Utilities for managing device path structures and inspecting firmware volumes.