summary refs log tree commit diff
path: root/pkgs/stdenv
diff options
context:
space:
mode:
authorLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2010-08-25 13:22:48 +0000
committerLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2010-08-25 13:22:48 +0000
commit0bfa3b030a07688a321d2a459917ae50064e906c (patch)
tree4ae47d59a97dd9edee8e35d2202894dc4469dc2a /pkgs/stdenv
parente7c47f424f14d4464abb805903a8050af2df6202 (diff)
downloadnixlib-0bfa3b030a07688a321d2a459917ae50064e906c.tar
nixlib-0bfa3b030a07688a321d2a459917ae50064e906c.tar.gz
nixlib-0bfa3b030a07688a321d2a459917ae50064e906c.tar.bz2
nixlib-0bfa3b030a07688a321d2a459917ae50064e906c.tar.lz
nixlib-0bfa3b030a07688a321d2a459917ae50064e906c.tar.xz
nixlib-0bfa3b030a07688a321d2a459917ae50064e906c.tar.zst
nixlib-0bfa3b030a07688a321d2a459917ae50064e906c.zip
Finally I wrote well building binutils before glibc in stdenvLinux.
I had done an attempt recently, unsuccesful, which ended in a recent revert.
This change works.
I even updated the comments in the file.


svn path=/nixpkgs/branches/stdenv-updates/; revision=23425
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r--pkgs/stdenv/linux/default.nix49
1 files changed, 36 insertions, 13 deletions
diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix
index 5654a8ccaf58..e1dd6d0edf2a 100644
--- a/pkgs/stdenv/linux/default.nix
+++ b/pkgs/stdenv/linux/default.nix
@@ -154,24 +154,46 @@ rec {
   
 
   # 2) These are the packages that we can build with the first
-  #    stdenv.  We only need Glibc (in step 3).
+  #    stdenv.  We only need binutils, because recent glibcs
+  #    require recent binutils, and those in bootstrap-tools may
+  #    be too old. (in step 3).
   stdenvLinuxBoot1Pkgs = allPackages {
     inherit system platform;
     bootStdenv = stdenvLinuxBoot1;
   };
 
+  firstBinutils = stdenvLinuxBoot1Pkgs.binutils;
+
+  # 3) 2nd stdenv that we will use to build only the glibc.
+  stdenvLinuxBoot1half = stdenvBootFun {
+    gcc = wrapGCC {
+      libc = bootstrapGlibc;
+      binutils = firstBinutils;
+      coreutils = bootstrapTools;
+    };
+    inherit fetchurl;
+  };
+
+
+  # 4) These are the packages that we can build with the 2nd
+  #    stdenv.  We only need Glibc (in step 5).
+  stdenvLinuxBoot1halfPkgs = allPackages {
+    inherit system platform;
+    bootStdenv = stdenvLinuxBoot1half;
+  };
+
   
-  # 3) Build Glibc with the bootstrap tools.  The result is the full,
+  # 5) Build Glibc with the bootstrap tools.  The result is the full,
   #    dynamically linked, final Glibc.
   stdenvLinuxGlibc = stdenvLinuxBoot1Pkgs.glibc;
 
   
-  # 4) Construct a second stdenv identical to the first, except that
+  # 6) Construct a third stdenv identical to the 2nd, except that
   #    this one uses the Glibc built in step 3.  It still uses
-  #    the rest of the bootstrap tools, including GCC.
+  #    the recent binutils and rest of the bootstrap tools, including GCC.
   stdenvLinuxBoot2 = removeAttrs (stdenvBootFun {
     gcc = wrapGCC {
-      binutils = bootstrapTools;
+      binutils = stdenvLinuxBoot1Pkgs.binutils;
       coreutils = bootstrapTools;
       libc = stdenvLinuxGlibc;
     };
@@ -183,7 +205,7 @@ rec {
   }) ["gcc" "binutils"];
 
   
-  # 5) The packages that can be built using the second stdenv.
+  # 7) The packages that can be built using the third stdenv.
   stdenvLinuxBoot2Pkgs = allPackages {
     inherit system platform;
     bootStdenv = stdenvLinuxBoot2;
@@ -202,7 +224,7 @@ rec {
         };
       });
 
-  # 6) Construct a third stdenv identical to the second, except that
+  # 8) Construct a fourth stdenv identical to the second, except that
   #    this one uses the dynamically linked GCC and Binutils from step
   #    5.  The other tools (e.g. coreutils) are still from the
   #    bootstrap tools.
@@ -221,19 +243,20 @@ rec {
   };
 
   
-  # 7) The packages that can be built using the third stdenv.
+  # 9) The packages that can be built using the fourth stdenv.
   stdenvLinuxBoot3Pkgs = allPackages {
     inherit system platform;
     bootStdenv = stdenvLinuxBoot3;
   };
 
   
-  # 8) Construct the final stdenv.  It uses the Glibc, GCC and
-  #    Binutils built above, and adds in dynamically linked versions
-  #    of all other tools.
+  # 10) Construct the final stdenv.  It uses the Glibc, GCC and
+  #     Binutils built above, and adds in dynamically linked versions
+  #     of all other tools.
   #
-  #    When updating stdenvLinux, make sure that the result has no
-  #    dependency (`nix-store -qR') on bootstrapTools.
+  #     When updating stdenvLinux, make sure that the result has no
+  #     dependency (`nix-store -qR') on bootstrapTools or the
+  #     first binutils built.
   stdenvLinux = import ../generic rec {
     name = "stdenv-linux";