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
This commit is contained in:
John Ericson 2017-02-11 19:28:13 -05:00
parent 23cc0c4420
commit 85b4d30c0b
2 changed files with 13 additions and 8 deletions

View file

@ -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 = ''

View file

@ -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;
});