From 85b4d30c0b464f6431eac6c50687111cfc69eb22 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sat, 11 Feb 2017 19:28:13 -0500 Subject: [PATCH] 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 --- pkgs/stdenv/linux/make-bootstrap-tools-cross.nix | 12 +++++++----- pkgs/top-level/all-packages.nix | 9 ++++++--- 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 8b166fb5b49..47c61aaad81 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 5da33b38244..a351284632b 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; });