diff --git a/build.zig b/build.zig index 5915b56..a688e6c 100644 --- a/build.zig +++ b/build.zig @@ -138,6 +138,11 @@ pub fn build(b: *std.Build) void { }); exe.setLinkerScript(b.path("src/kernel/arch/x86_64/linker.ld")); exe.entry = .{ .symbol_name = "_start" }; + // The self-hosted linker ignores parts of the linker script (PHDRS, + // /DISCARD/, section order); the higher-half layout depends on the script + // being authoritative, so pin the kernel to LLVM + LLD. + exe.use_llvm = true; + exe.use_lld = true; // Physical address the bootloader loads the kernel to (identity-mapped under // UEFI). Overrides Zig's default image base so the linker script's layout is // honoured; adjust here if it collides with firmware-reserved memory.