linuxKernel: depend exclusively on elfutils

This commit is contained in:
Philip Taron
2024-06-18 14:54:33 -07:00
parent 7d329d1a9e
commit aab5651662
+19 -12
View File
@@ -1,5 +1,5 @@
{ lib, stdenv, buildPackages, runCommand, nettools, bc, bison, flex, perl, rsync, gmp, libmpc, mpfr, openssl
, libelf, cpio, elfutils, zstd, python3Minimal, zlib, pahole, kmod, ubootTools
, cpio, elfutils, zstd, python3Minimal, zlib, pahole, kmod, ubootTools
, fetchpatch
, rustc, rust-bindgen, rustPlatform
}:
@@ -120,7 +120,7 @@ let
moduleBuildDependencies = [
pahole
perl
libelf
elfutils
# module makefiles often run uname commands to find out the kernel version
(buildPackages.deterministic-uname.override { inherit modDirVersion; })
]
@@ -142,13 +142,23 @@ let
inherit src;
depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ perl bc nettools openssl rsync gmp libmpc mpfr zstd python3Minimal kmod ]
++ optional needsUbootTools ubootTools
++ optional (lib.versionOlder version "5.8") libelf
++ optionals (lib.versionAtLeast version "4.16") [ bison flex ]
++ optionals (lib.versionAtLeast version "5.2") [ cpio pahole zlib ]
++ optional (lib.versionAtLeast version "5.8") elfutils
++ optionals withRust [ rustc rust-bindgen ];
nativeBuildInputs = [
perl
bc
nettools
openssl
rsync
gmp
libmpc
mpfr
elfutils
zstd
python3Minimal
kmod
] ++ optional needsUbootTools ubootTools
++ optionals (lib.versionAtLeast version "4.16") [ bison flex ]
++ optionals (lib.versionAtLeast version "5.2") [ cpio pahole zlib ]
++ optionals withRust [ rustc rust-bindgen ];
RUST_LIB_SRC = lib.optionalString withRust rustPlatform.rustLibSrc;
@@ -400,9 +410,6 @@ let
};
in
assert lib.versionOlder version "5.8" -> libelf != null;
assert lib.versionAtLeast version "5.8" -> elfutils != null;
stdenv.mkDerivation ((drvAttrs config stdenv.hostPlatform.linux-kernel kernelPatches configfile) // {
inherit pname version;