From 91aff2bc4a89d547bc82529c06c18010d77d49d6 Mon Sep 17 00:00:00 2001 From: Daniel Samson <12231216+daniel-samson@users.noreply.github.com> Date: Wed, 8 Jul 2026 22:17:02 +0100 Subject: [PATCH] pin the kernel to LLVM+LLD The self-hosted linker ignores parts of linker.ld (PHDRS, /DISCARD/, section order). The higher-half move needs the script authoritative. Suite 27/27 on the LLD build. Co-Authored-By: Claude Fable 5 --- build.zig | 5 +++++ 1 file changed, 5 insertions(+) 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.