@@ -1,4 +1,6 @@
11{ runCommand, nettools, bc, perl, gmp, libmpc, mpfr, kmod, openssl
2+, libelf ? null
3+, utillinux ? null
24, writeTextFile, ubootTools
35, hostPlatform
46}:
@@ -230,13 +232,18 @@ let
230232 };
231233in
232234
235+assert stdenv.lib.versionAtLeast version "4.15" -> libelf != null;
236+assert stdenv.lib.versionAtLeast version "4.15" -> utillinux != null;
233237stdenv.mkDerivation ((drvAttrs config stdenv.platform (kernelPatches ++ nativeKernelPatches) configfile) // {
234238 name = "linux-${version}";
235239
236240 enableParallelBuilding = true;
237241
238242 nativeBuildInputs = [ perl bc nettools openssl gmp libmpc mpfr ]
239− ++ optional (stdenv.platform.kernelTarget == "uImage") ubootTools;
243+ ++ optional (stdenv.platform.kernelTarget == "uImage") ubootTools
244+ ++ optional (stdenv.lib.versionAtLeast version "4.15") libelf
245+ ++ optional (stdenv.lib.versionAtLeast version "4.15") utillinux
246+ ;
240247
241248 hardeningDisable = [ "bindnow" "format" "fortify" "stackprotector" "pic" ];
242249