about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJohn Ericson <Ericson2314@Yahoo.com>2017-02-11 19:28:13 -0500
committerJohn Ericson <Ericson2314@Yahoo.com>2017-04-25 21:31:50 -0400
commit85b4d30c0b464f6431eac6c50687111cfc69eb22 (patch)
treeefcdb3fedb791a7ce761ebd1eb0d0005ea55c7b1
parent23cc0c4420d3b2d5fb023f2368ba7d11412c1fba (diff)
downloadnixlib-85b4d30c0b464f6431eac6c50687111cfc69eb22.tar
nixlib-85b4d30c0b464f6431eac6c50687111cfc69eb22.tar.gz
nixlib-85b4d30c0b464f6431eac6c50687111cfc69eb22.tar.bz2
nixlib-85b4d30c0b464f6431eac6c50687111cfc69eb22.tar.lz
nixlib-85b4d30c0b464f6431eac6c50687111cfc69eb22.tar.xz
nixlib-85b4d30c0b464f6431eac6c50687111cfc69eb22.tar.zst
nixlib-85b4d30c0b464f6431eac6c50687111cfc69eb22.zip
binutils: Respect the targetPlatform
Use `buildPackages.binutils` to get build = host != target binutils,
i.e. the old `binutilsCross`, and use
`buildPackages.buildPackages.binutils` to get build = host = target
binutils, i.e. the old `binutils`.

`buildPackages` chains like this are supposed to remove the need for
all such `*Cross` derivations. We start with binutils because it's
comparatively easy.

No hashes of cross-tests should be changed
-rw-r--r--pkgs/stdenv/linux/make-bootstrap-tools-cross.nix12
-rw-r--r--pkgs/top-level/all-packages.nix9
2 files changed, 13 insertions, 8 deletions
diff --git a/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix b/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix
index 8b166fb5b49f..47c61aaad818 100644
--- a/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix
+++ b/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix
@@ -70,8 +70,6 @@ let
 
   pkgs = pkgsFun ({inherit system;} // selectedCrossSystem);
 
-  inherit (pkgs.buildPackages) stdenv nukeReferences cpio binutilsCross;
-
   glibc = pkgs.buildPackages.libcCross;
   bash = pkgs.bash;
   findutils = pkgs.findutils;
@@ -126,11 +124,15 @@ rec {
 
   build =
 
-    stdenv.mkDerivation {
+    pkgs.buildPackages.stdenv.mkDerivation {
       name = "stdenv-bootstrap-tools-cross";
       crossConfig = pkgs.hostPlatform.config;
 
-      buildInputs = [nukeReferences cpio binutilsCross];
+      buildInputs = [
+        pkgs.buildPackages.nukeReferences
+        pkgs.buildPackages.cpio
+        pkgs.buildPackages.binutils
+      ];
 
       buildCommand = ''
         set -x
@@ -261,7 +263,7 @@ rec {
       allowedReferences = [];
     };
 
-  dist = stdenv.mkDerivation {
+  dist = pkgs.buildPackages.stdenv.mkDerivation {
     name = "stdenv-bootstrap-tools-cross";
 
     buildCommand = ''
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 5da33b382446..a351284632bb 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -6336,10 +6336,13 @@ with pkgs;
 
   binutils = if stdenv.isDarwin then darwin.binutils else binutils-raw;
 
-  binutils-raw = callPackage ../development/tools/misc/binutils { inherit noSysDirs; };
+  binutils-raw = callPackage ../development/tools/misc/binutils {
+    # FHS sys dirs presumably only have stuff for the build platform
+    noSysDirs = (targetPlatform != buildPlatform) || noSysDirs;
+    cross = if targetPlatform != hostPlatform then targetPlatform else null;
+  };
 
-  binutils_nogold = lowPrio (callPackage ../development/tools/misc/binutils {
-    inherit noSysDirs;
+  binutils_nogold = lowPrio (binutils-raw.override {
     gold = false;
   });