From 1e6c4457678c650bf0577a019d825effe637641e Mon Sep 17 00:00:00 2001 From: Yarny0 <41838844+Yarny0@users.noreply.github.com> Date: Sat, 10 May 2025 09:28:18 +0200 Subject: [PATCH] linux/common-config: disable OF_OVERLAY on x86_64 if version < 5.15 `OF_OVERLAY` breaks kernel compilation for version 5.10 (beginning with 5.10.236), but only on x86_64. Luckily, `OF_OVERLAY` is of not real interest on x86_64, so this commit unbreaks the build by just disabling that option if the target is x86_64 *and* the kernel version is below 5.15. v5.15 contains a patch that turns the compilation error into a warning, so this measure is not needed from that version on: https://git.kernel.org/linus/5aad03685185b5133a28e1ee1d4e98d3fd3642a3 The reasons for the build failure are not fully clear at the time of this writing; apparently, a change in `pahole` is the core cause. For details see the issue and in particular this comment: https://github.com/NixOS/nixpkgs/issues/403985#issuecomment-2863338895 If that is correct and `pahole` gets fixed, we can probably revert the commit at hand. --- pkgs/os-specific/linux/kernel/common-config.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/kernel/common-config.nix b/pkgs/os-specific/linux/kernel/common-config.nix index 0c5ee542de44..5c1140b45a0e 100644 --- a/pkgs/os-specific/linux/kernel/common-config.nix +++ b/pkgs/os-specific/linux/kernel/common-config.nix @@ -1102,7 +1102,10 @@ let # enable support for device trees and overlays OF = option yes; - OF_OVERLAY = option yes; + # OF_OVERLAY breaks v5.10 on x86_64, see https://github.com/NixOS/nixpkgs/issues/403985 + OF_OVERLAY = lib.mkIf (!(lib.versionOlder version "5.15" && stdenv.hostPlatform.isx86_64)) ( + option yes + ); # Enable initrd support. BLK_DEV_INITRD = yes;