diff --git a/pkgs/stdenv/linux/make-bootstrap-tools.nix b/pkgs/stdenv/linux/make-bootstrap-tools.nix index 1c71f9defaf..5e31b9d07cf 100644 --- a/pkgs/stdenv/linux/make-bootstrap-tools.nix +++ b/pkgs/stdenv/linux/make-bootstrap-tools.nix @@ -7,13 +7,14 @@ let # stdenv-linux's dependencies, rather than building new ones with # dietlibc. bootStdenv = removeAttrs (pkgs.useDietLibC pkgs.stdenv) - ["coreutils" "gnused" "gnutar" "gnugrep" "bzip2" "bash" "patch" "patchelf"]; + ["binutils" "coreutils" "gnused" "gnugrep" "gnutar" "gzip" "bzip2" "bash" "patch" "patchelf"]; }; generator = pkgs.stdenv.mkDerivation { name = "bootstrap-tools-generator"; builder = ./make-bootstrap-tools.sh; - inherit (pkgsDiet) coreutils gnused gnugrep gnutar bzip2 bash patch; + inherit (pkgsDiet) coreutils gnused gnugrep gnutar gzip bzip2 bash patch; + binutils = pkgsDiet.binutils; curl = pkgsDiet.realCurl; # The result should not contain any references (store paths) so diff --git a/pkgs/stdenv/linux/make-bootstrap-tools.sh b/pkgs/stdenv/linux/make-bootstrap-tools.sh index fee37373c92..acbfe8ad19b 100644 --- a/pkgs/stdenv/linux/make-bootstrap-tools.sh +++ b/pkgs/stdenv/linux/make-bootstrap-tools.sh @@ -17,6 +17,8 @@ nukeRefs() { } +# Create the tools that need to be in-tree, i.e., the ones that are +# necessary for the absolute first stage of the bootstrap. cp $bash/bin/bash $out/in-nixpkgs cp $bzip2/bin/bunzip2 $out/in-nixpkgs cp $gnutar/bin/tar $out/in-nixpkgs @@ -27,6 +29,7 @@ nukeRefs $out/in-nixpkgs/bash nukeRefs $out/in-nixpkgs/tar +# Create the tools tarball. mkdir tools mkdir tools/bin @@ -37,6 +40,7 @@ rm tools/bin/printf # idem cp $gnused/bin/* tools/bin cp $gnugrep/bin/* tools/bin cp $gnutar/bin/* tools/bin +cp $gunzip/bin/gunzip tools/bin cp $bzip2/bin/bunzip2 tools/bin cp $patch/bin/* tools/bin @@ -47,7 +51,17 @@ nukeRefs tools/bin/grep #cp $patchelf/bin/* tools/bin -for i in $out/in-nixpkgs/* tools/bin/*; do +# Create the binutils tarball. +mkdir binutils +mkdir binutils/bin +for i in as ld ar ranlib nm strip; do + cp $binutils/bin/$i binutils/bin + nukeRefs binutils/bin/$i +done + + +# Strip executables even further. +for i in $out/in-nixpkgs/* */bin/*; do if test -x $i; then chmod +w $i strip -s $i || true @@ -55,9 +69,10 @@ for i in $out/in-nixpkgs/* tools/bin/*; do done -tar cvfj $out/on-server/static-tools.tar.bz2 tools - +# Pack, unpack everything. +tar cfj $out/on-server/static-tools.tar.bz2 tools +tar cfj $out/on-server/binutils.tar.bz2 binutils for i in $out/on-server/*.tar.bz2; do - (cd $out/check-only && tar xvfj $i) + (cd $out/check-only && tar xfj $i) done diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b46d0f4e32e..9594ee934de 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -957,9 +957,8 @@ rec { cross = "sparc-linux"; }; - binutilsDiet = import ../development/tools/misc/binutils/binutils-2.17.nix { - inherit fetchurl noSysDirs; - stdenv = useDietLibC stdenv; + binutils217 = import ../development/tools/misc/binutils/binutils-2.17.nix { + inherit fetchurl stdenv noSysDirs; }; bison = bison1875;