From af5dd576e0830b5a5cfc6e56f58e2af4356abf82 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Wed, 20 Aug 2025 21:57:14 +0200 Subject: [PATCH] zfs: pass kernel build flags correctly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ZFS's autoconf scripts recognize KERNEL_CC, KERNEL_CROSS_COMPILE, KERNEL_ARCH, etc. This avoids the need to separately give them as Make flags, although I'm not sure what the original intention behind giving the unprefixed flags to configure was — the commit adding that doesn't say, except that it was to fix cross, which still works after this change. This fixes the ZFS kernel module build after the change to use unwrapped compilers for building the kernel, which previously resulted in CC etc. being clobbered for the ZFS build, even for non-kernel parts like the "compiler works" Autoconf check. --- pkgs/os-specific/linux/zfs/generic.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/os-specific/linux/zfs/generic.nix b/pkgs/os-specific/linux/zfs/generic.nix index d27fe8511434..98d0236bcd90 100644 --- a/pkgs/os-specific/linux/zfs/generic.nix +++ b/pkgs/os-specific/linux/zfs/generic.nix @@ -221,11 +221,9 @@ let "--with-linux=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source" "--with-linux-obj=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" ] - ++ kernelModuleMakeFlags + ++ map (f: "KERNEL_${f}") kernelModuleMakeFlags ); - makeFlags = optionals buildKernel kernelModuleMakeFlags; - enableParallelBuilding = true; doInstallCheck = true;