linux: inline "commonMakeFlags"

Since 7a9b6ac39a ("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.
This commit is contained in:
Alyssa Ross 2022-07-28 17:31:42 +00:00
parent e1b3ee51e3
commit c48f9c6218
No known key found for this signature in database
GPG key ID: F9DBED4859B271C0

View file

@ -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; }))