From c48f9c6218c5af9de8220a1fc6aef15af35e0a4b Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Thu, 28 Jul 2022 17:31:42 +0000 Subject: [PATCH] linux: inline "commonMakeFlags" Since 7a9b6ac39a3 ("kernel: Enable cross compiling"), commonMakeFlags has only been used once. Since these flags aren't "common" between anything any more, they should just be inlined to make the expression easier to read. --- pkgs/os-specific/linux/kernel/manual-config.nix | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix index acf965d99507..0463ea7e97bd 100644 --- a/pkgs/os-specific/linux/kernel/manual-config.nix +++ b/pkgs/os-specific/linux/kernel/manual-config.nix @@ -68,11 +68,6 @@ let cp -av $3 $4 ''; }; - commonMakeFlags = [ - "O=$(buildRoot)" - ] ++ lib.optionals (stdenv.hostPlatform.linux-kernel ? makeFlags) - stdenv.hostPlatform.linux-kernel.makeFlags; - drvAttrs = config_: kernelConf: kernelPatches: configfile: let config = let attrName = attr: "CONFIG_" + attr; in { @@ -335,13 +330,15 @@ stdenv.mkDerivation ((drvAttrs config stdenv.hostPlatform.linux-kernel kernelPat hardeningDisable = [ "bindnow" "format" "fortify" "stackprotector" "pic" "pie" ]; # Absolute paths for compilers avoid any PATH-clobbering issues. - makeFlags = commonMakeFlags ++ [ + makeFlags = [ + "O=$(buildRoot)" "CC=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc" "HOSTCC=${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}cc" "ARCH=${stdenv.hostPlatform.linuxArch}" ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [ "CROSS_COMPILE=${stdenv.cc.targetPrefix}" - ] ++ extraMakeFlags; + ] ++ (stdenv.hostPlatform.linux-kernel.makeFlags or []) + ++ extraMakeFlags; karch = stdenv.hostPlatform.linuxArch; } // (optionalAttrs (pos != null) { inherit pos; }))