summary refs log tree commit diff
path: root/pkgs/os-specific/linux/kernel/generic.nix
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2018-02-11 18:38:06 +0100
committerVladimír Čunát <vcunat@gmail.com>2018-02-11 18:55:18 +0100
commitae040525d8aa01e81ffd1d1c97c908a6e63c819f (patch)
treeec4e8becfdcda88cf34452ea4be808826ab29de6 /pkgs/os-specific/linux/kernel/generic.nix
parent1f4ac3bc795a7386414ba9519087f1796fa9c987 (diff)
downloadnixpkgs-ae040525d8aa01e81ffd1d1c97c908a6e63c819f.tar
nixpkgs-ae040525d8aa01e81ffd1d1c97c908a6e63c819f.tar.gz
nixpkgs-ae040525d8aa01e81ffd1d1c97c908a6e63c819f.tar.bz2
nixpkgs-ae040525d8aa01e81ffd1d1c97c908a6e63c819f.tar.lz
nixpkgs-ae040525d8aa01e81ffd1d1c97c908a6e63c819f.tar.xz
nixpkgs-ae040525d8aa01e81ffd1d1c97c908a6e63c819f.tar.zst
nixpkgs-ae040525d8aa01e81ffd1d1c97c908a6e63c819f.zip
linux-*: build with gcc7, but allow overriding it
I expect we will revert this after general upgrade to gcc7.
See https://github.com/NixOS/nixpkgs/issues/34383
Diffstat (limited to 'pkgs/os-specific/linux/kernel/generic.nix')
-rw-r--r--pkgs/os-specific/linux/kernel/generic.nix9
1 files changed, 8 insertions, 1 deletions
diff --git a/pkgs/os-specific/linux/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix
index ebd889d1a99..0bed93d76ed 100644
--- a/pkgs/os-specific/linux/kernel/generic.nix
+++ b/pkgs/os-specific/linux/kernel/generic.nix
@@ -4,10 +4,15 @@
 , utillinux
 , writeTextFile, ubootTools
 , callPackage
+, overrideCC, gcc7
 }:
 
 { stdenv, buildPackages, perl, buildLinux
 
+, # Allow really overriding even our gcc7 default.
+  # We want gcc >= 7.3 to enable the "retpoline" mitigation of security problems.
+  stdenvNoOverride ? overrideCC stdenv gcc7
+
 , # The kernel source tarball.
   src
 
@@ -32,12 +37,14 @@
   # optionally be compressed with gzip or bzip2.
   kernelPatches ? []
 , ignoreConfigErrors ? hostPlatform.platform.name != "pc" ||
-                       hostPlatform != stdenv.buildPlatform
+                       hostPlatform != stdenvNoOverride.buildPlatform
 , extraMeta ? {}
 , hostPlatform
 , ...
 } @ args:
 
+let stdenv = stdenvNoOverride; in # finish the rename
+
 assert stdenv.isLinux;
 
 let