From 1e77d0b975ad714dc3c619bdddd949f94ec2fc79 Mon Sep 17 00:00:00 2001 From: David Guibert Date: Thu, 28 Dec 2017 09:11:36 +0100 Subject: kernel 4.14 require libelf to compile modules. [...] make modules -C /nix/store/h1vzl6bq4wif3m8dd1bw2p3fv4shjg3n-linux-4.14.9-dev/lib/modules/4.14.9/build EXTRA_CFLAGS=-Werror-implicit-function-declaration M=/tmp/nix-build-spl-kernel-2017-11-16-4.14.9.drv-0/source/build /nix/store/h1vzl6bq4wif3m8dd1bw2p3fv4shjg3n-linux-4.14.9-dev/lib/modules/4.14.9/source/Makefile:939: *** "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel". Stop. This patch introduces kernel.moduleBuildDependencies to avoid the logic "stdenv.lib.optional (stdenv.lib.versionAtLeast kernel.version "4.14") libelf" in multiple places. [dezgeg did some minor tweaks on top] --- pkgs/os-specific/linux/kernel/manual-config.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'pkgs/os-specific/linux/kernel/manual-config.nix') diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix index 355fbde6268..e1936495921 100644 --- a/pkgs/os-specific/linux/kernel/manual-config.nix +++ b/pkgs/os-specific/linux/kernel/manual-config.nix @@ -49,6 +49,9 @@ let inherit (stdenv.lib) hasAttr getAttr optional optionalString optionalAttrs maintainers platforms; + # Dependencies that are required to build kernel modules + moduleBuildDependencies = stdenv.lib.optional (stdenv.lib.versionAtLeast version "4.14") libelf; + installkernel = writeTextFile { name = "installkernel"; executable=true; text = '' #!${stdenv.shell} -e mkdir -p $4 @@ -85,7 +88,7 @@ let (isModular || (config.isDisabled "FIRMWARE_IN_KERNEL")); in (optionalAttrs isModular { outputs = [ "out" "dev" ]; }) // { passthru = { - inherit version modDirVersion config kernelPatches configfile; + inherit version modDirVersion config kernelPatches configfile moduleBuildDependencies; }; inherit src; -- cgit 1.4.1