about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAdam Joseph <adam@westernsemico.com>2023-04-27 14:47:14 -0700
committerAdam Joseph <adam@westernsemico.com>2023-04-27 15:22:06 -0700
commitcfc4c957706ec37c67ed6800148fab6c72f1367d (patch)
tree4be03ca957c77f7170d33619cda5035d6a0bc1c4
parentd7d3821ab83260e5b9d376b39fa139989c61c978 (diff)
downloadnixlib-cfc4c957706ec37c67ed6800148fab6c72f1367d.tar
nixlib-cfc4c957706ec37c67ed6800148fab6c72f1367d.tar.gz
nixlib-cfc4c957706ec37c67ed6800148fab6c72f1367d.tar.bz2
nixlib-cfc4c957706ec37c67ed6800148fab6c72f1367d.tar.lz
nixlib-cfc4c957706ec37c67ed6800148fab6c72f1367d.tar.xz
nixlib-cfc4c957706ec37c67ed6800148fab6c72f1367d.tar.zst
nixlib-cfc4c957706ec37c67ed6800148fab6c72f1367d.zip
gcc: fix fastStdenv breakage from #209870
Apparently gcc has these `Makefile` targets:

- `""`
- `"bootstrap"`
- `"profiledbootstrap"`

... but no `"profiled"`.  So if you want a profiled compiler, at the
moment, it should be bootstrapped.

If we ever decide to make the nixpkgs bootstrap use a profiled
compiler (which at the moment means nondeterminism) a Nix-driven
profile loop is certainly possible, but would take some work.

Closes #228597.
-rw-r--r--pkgs/development/compilers/gcc/12/default.nix4
1 files changed, 3 insertions, 1 deletions
diff --git a/pkgs/development/compilers/gcc/12/default.nix b/pkgs/development/compilers/gcc/12/default.nix
index a3e8faaed460..483ac2024402 100644
--- a/pkgs/development/compilers/gcc/12/default.nix
+++ b/pkgs/development/compilers/gcc/12/default.nix
@@ -56,7 +56,7 @@ with builtins;
 
 let majorVersion = "12";
     version = "${majorVersion}.2.0";
-    disableBootstrap = !stdenv.hostPlatform.isDarwin;
+    disableBootstrap = !stdenv.hostPlatform.isDarwin && !profiledCompiler;
 
     inherit (stdenv) buildPlatform hostPlatform targetPlatform;
 
@@ -288,6 +288,8 @@ lib.pipe (stdenv.mkDerivation ({
   targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;
 
   buildFlags =
+    # we do not yet have Nix-driven profiling
+    assert profiledCompiler -> !disableBootstrap;
     let target =
           lib.optionalString (profiledCompiler) "profiled" +
           lib.optionalString (targetPlatform == hostPlatform && hostPlatform == buildPlatform && !disableBootstrap) "bootstrap";