From 0f7bceeb502d240cf767a60754cf1d6ddbcf6272 Mon Sep 17 00:00:00 2001 From: Nexoniarz Date: Sat, 24 Oct 2026 15:28:32 +0200 Subject: [PATCH] shell.nix: no hardening flags Nix's compiler wrapper adds -fPIC and friends to every compile. The kernel is freestanding at fixed addresses, and clang refuses -fPIC for the UEFI loader's PE target outright, so a plain make in nix-shell stopped at BOOTX64.EFI. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01S1giNvrHTrPMPw7V6x1kQ4 --- shell.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/shell.nix b/shell.nix index 0da3540..2a63eb7 100644 --- a/shell.nix +++ b/shell.nix @@ -16,6 +16,14 @@ pkgs.mkShell { name = "schos"; + # Off, all of it. Nix's compiler wrapper adds -fPIC, -fstack-protector, + # -D_FORTIFY_SOURCE and friends to every compile, which is right for Linux + # programs and wrong for everything here: the kernel is freestanding and + # linked at fixed addresses, and the UEFI loader targets PE/COFF, where clang + # refuses -fPIC outright ("unsupported option '-fPIC' for target + # 'x86_64-unknown-windows-msvc'") and `make` stops at BOOTX64.EFI. + hardeningDisable = [ "all" ]; + nativeBuildInputs = with pkgs; [ # The cross-compiler, and the reason this file exists. clang targets # bare-metal ELF, 16-bit code and PE/COFF from one install; lld-link is what