mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-01 09:44:18 +00:00
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:
parent
e1b3ee51e3
commit
c48f9c6218
@ -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; }))
|
||||
|
Loading…
Reference in New Issue
Block a user