From 70d34589bd7b890afc1eeafa0eb739fbf6676df0 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Mon, 9 Jan 2023 00:09:53 -0800 Subject: stdenv/linux: factor out commonGccOverrides This commit has no effect on eval. It simply factors out a common subexpression. --- pkgs/stdenv/linux/default.nix | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'pkgs/stdenv/linux') diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index 51f217f03b276..1ce284f656013 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -111,6 +111,13 @@ let isBuiltByBootstrapFilesCompiler = pkg: isFromNixpkgs pkg && isFromBootstrapFiles pkg.stdenv.cc.cc; + commonGccOverrides = { + # Use a deterministically built compiler + # see https://github.com/NixOS/nixpkgs/issues/108475 for context + reproducibleBuild = true; + profiledCompiler = false; + }; + commonPreHook = '' export NIX_ENFORCE_PURITY="''${NIX_ENFORCE_PURITY-1}" @@ -396,7 +403,7 @@ in let makeStaticLibrariesAndMark = pkg: lib.makeOverridable (pkg.override { stdenv = self.makeStaticLibraries self.stdenv; }) .overrideAttrs (a: { pname = "${a.pname}-stage3"; }); - in super.gcc-unwrapped.override { + in super.gcc-unwrapped.override (commonGccOverrides // { # Link GCC statically against GMP etc. This makes sense because # these builds of the libraries are only used by GCC, so it # reduces the size of the stdenv closure. @@ -404,11 +411,7 @@ in mpfr = makeStaticLibrariesAndMark super.mpfr; libmpc = makeStaticLibrariesAndMark super.libmpc; isl = makeStaticLibrariesAndMark super.isl_0_20; - # Use a deterministically built compiler - # see https://github.com/NixOS/nixpkgs/issues/108475 for context - reproducibleBuild = true; - profiledCompiler = false; - }; + }); }; extraNativeBuildInputs = [ prevStage.patchelf ] ++ # Many tarballs come with obsolete config.sub/config.guess that don't recognize aarch64. -- cgit 1.4.1