summary refs log tree commit diff
path: root/pkgs/stdenv/darwin
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2017-08-26 11:43:30 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2017-12-13 16:08:18 -0500
commit2bba92906231ae021b4778986419320c3792ce48 (patch)
treeeb6f8526328212ec104c8851a18d93b804722099 /pkgs/stdenv/darwin
parent8e557ed2c58e6ce48a8d05dbc57ef84e98b4cecd (diff)
downloadnixpkgs-2bba92906231ae021b4778986419320c3792ce48.tar
nixpkgs-2bba92906231ae021b4778986419320c3792ce48.tar.gz
nixpkgs-2bba92906231ae021b4778986419320c3792ce48.tar.bz2
nixpkgs-2bba92906231ae021b4778986419320c3792ce48.tar.lz
nixpkgs-2bba92906231ae021b4778986419320c3792ce48.tar.xz
nixpkgs-2bba92906231ae021b4778986419320c3792ce48.tar.zst
nixpkgs-2bba92906231ae021b4778986419320c3792ce48.zip
bintools-wrapper: Import separately from cc-wrapper
Diffstat (limited to 'pkgs/stdenv/darwin')
-rw-r--r--pkgs/stdenv/darwin/default.nix62
1 files changed, 39 insertions, 23 deletions
diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix
index 89c903b04a0..d202186c29b 100644
--- a/pkgs/stdenv/darwin/default.nix
+++ b/pkgs/stdenv/darwin/default.nix
@@ -60,10 +60,40 @@ in rec {
                           extraBuildInputs,
                           allowedRequisites ? null}:
     let
+      buildPackages = lib.optionalAttrs (last ? stdenv) {
+        inherit (last) stdenv;
+      };
+
+      coreutils = { name = "coreutils-9.9.9"; outPath = bootstrapTools; };
+      gnugrep   = { name = "gnugrep-9.9.9";   outPath = bootstrapTools; };
+
+      bintools = import ../../build-support/bintools-wrapper {
+        inherit shell;
+        inherit (last) stdenvNoCC;
+
+        nativeTools  = false;
+        nativeLibc   = false;
+        inherit buildPackages coreutils gnugrep;
+        libc         = last.pkgs.darwin.Libsystem;
+        bintools     = { name = "binutils-9.9.9";  outPath = bootstrapTools; };
+      };
+
+      cc = if isNull last then "/dev/null" else import ../../build-support/cc-wrapper {
+        inherit shell;
+        inherit (last) stdenvNoCC;
+
+        nativeTools  = false;
+        nativeLibc   = false;
+        inherit buildPackages coreutils gnugrep bintools;
+        libc         = last.pkgs.darwin.Libsystem;
+        isClang      = true;
+        cc           = { name = "clang-9.9.9";     outPath = bootstrapTools; };
+      };
+
       thisStdenv = import ../generic {
         inherit config shell extraNativeBuildInputs extraBuildInputs;
         allowedRequisites = if allowedRequisites == null then null else allowedRequisites ++ [
-          thisStdenv.cc.expand-response-params
+          cc.expand-response-params cc.bintools
         ];
 
         name = "stdenv-darwin-boot-${toString step}";
@@ -72,24 +102,9 @@ in rec {
         hostPlatform = localSystem;
         targetPlatform = localSystem;
 
-        cc = if isNull last then "/dev/null" else import ../../build-support/cc-wrapper {
-          inherit shell;
-          inherit (last) stdenvNoCC;
-
-          nativeTools  = false;
-          nativeLibc   = false;
-          buildPackages = lib.optionalAttrs (last ? stdenv) {
-            inherit (last) stdenv;
-          };
-          libc         = last.pkgs.darwin.Libsystem;
-          isClang      = true;
-          cc           = { name = "clang-9.9.9";     outPath = bootstrapTools; };
-          binutils     = { name = "binutils-9.9.9";  outPath = bootstrapTools; };
-          coreutils    = { name = "coreutils-9.9.9"; outPath = bootstrapTools; };
-          gnugrep      = { name = "gnugrep-9.9.9";   outPath = bootstrapTools; };
-        };
+        inherit cc;
 
-        preHook = stage0.stdenv.lib.optionalString (shell == "${bootstrapTools}/bin/bash") ''
+        preHook = lib.optionalString (shell == "${bootstrapTools}/bin/bash") ''
           # Don't patch #!/interpreter because it leads to retained
           # dependencies on the bootstrapTools in the final stdenv.
           dontPatchShebangs=1
@@ -328,9 +343,10 @@ in rec {
       buildPackages = {
         inherit (prevStage) stdenv;
       };
-      inherit (pkgs) coreutils binutils gnugrep;
-      cc   = pkgs.llvmPackages.clang-unwrapped;
-      libc = pkgs.darwin.Libsystem;
+      inherit (pkgs) coreutils gnugrep;
+      cc       = pkgs.llvmPackages.clang-unwrapped;
+      bintools = pkgs.darwin.binutils;
+      libc     = pkgs.darwin.Libsystem;
     };
 
     extraNativeBuildInputs = [];
@@ -349,8 +365,8 @@ in rec {
       xz.out xz.bin libcxx libcxxabi gmp.out gnumake findutils bzip2.out
       bzip2.bin llvmPackages.llvm llvmPackages.llvm.lib zlib.out zlib.dev libffi.out coreutils ed diffutils gnutar
       gzip ncurses.out ncurses.dev ncurses.man gnused bash gawk
-      gnugrep llvmPackages.clang-unwrapped patch pcre.out binutils-raw.out
-      binutils gettext
+      gnugrep llvmPackages.clang-unwrapped patch pcre.out gettext
+      binutils-raw.bintools binutils binutils.bintools
       cc.expand-response-params
     ]) ++ (with pkgs.darwin; [
       dyld Libsystem CF cctools ICU libiconv locale