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 <noreply@anthropic.com>
This commit is contained in:
Daniel Samson
2026-07-08 22:17:02 +01:00
co-authored by Claude Fable 5
parent 546dd44a2a
commit 91aff2bc4a
+5
View File
@@ -138,6 +138,11 @@ pub fn build(b: *std.Build) void {
}); });
exe.setLinkerScript(b.path("src/kernel/arch/x86_64/linker.ld")); exe.setLinkerScript(b.path("src/kernel/arch/x86_64/linker.ld"));
exe.entry = .{ .symbol_name = "_start" }; 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 // 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 // UEFI). Overrides Zig's default image base so the linker script's layout is
// honoured; adjust here if it collides with firmware-reserved memory. // honoured; adjust here if it collides with firmware-reserved memory.