From dbf6d20d64af8572ae4a24850244befc475eea9e Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sat, 26 Aug 2017 11:43:30 -0400 Subject: binutils-wrapper: Import separately from cc-wrapper --- pkgs/stdenv/darwin/default.nix | 55 +++++++++++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 20 deletions(-) (limited to 'pkgs/stdenv/darwin') diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix index f4801d674e8a..d71cda7f8a96 100644 --- a/pkgs/stdenv/darwin/default.nix +++ b/pkgs/stdenv/darwin/default.nix @@ -63,10 +63,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; }; + + binutils = import ../../build-support/binutils-wrapper { + inherit shell; + inherit (last) stdenv; + + nativeTools = false; + nativeLibc = false; + inherit buildPackages coreutils gnugrep; + libc = last.pkgs.darwin.Libsystem; + binutils = { name = "binutils-9.9.9"; outPath = bootstrapTools; }; + }; + + cc = if isNull last then "/dev/null" else import ../../build-support/cc-wrapper { + inherit shell; + inherit (last) stdenv; + + nativeTools = false; + nativeLibc = false; + inherit buildPackages coreutils gnugrep binutils; + 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.binutils ]; name = "stdenv-darwin-boot-${toString step}"; @@ -75,24 +105,9 @@ in rec { hostPlatform = localSystem; targetPlatform = localSystem; - cc = if isNull last then "/dev/null" else import ../../build-support/cc-wrapper { - inherit shell; - inherit (last) stdenv; - - 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 @@ -350,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-raw.dev binutils gettext + gnugrep llvmPackages.clang-unwrapped patch pcre.out gettext + binutils-raw.binutils.out binutils-raw.binutils.dev binutils binutils.binutils cc.expand-response-params ]) ++ (with pkgs.darwin; [ dyld Libsystem CF cctools ICU libiconv locale -- cgit 1.4.1