binutils: Don't pass --host etc. when not cross-compiling

Or linuxHeaders build fails on ARM (non-cross) since e826a6a2477404:

````
  HOSTCC  scripts/basic/fixdep
/nix/store/9glws7v2j28blv1n7azqr3b43qadjd1j-binutils-2.28.1/bin/ld: unrecognised emulation mode: armelf_linux_eabi
Supported emulations: armelf_linux armelf armelfb armelfb_linux
collect2: error: ld returned 1 exit status
````
This commit is contained in:
Tuomas Tynkkynen 2017-08-17 18:24:07 +03:00
parent d8bea2498d
commit 88efc22b44
1 changed files with 1 additions and 1 deletions

View File

@ -84,7 +84,7 @@ stdenv.mkDerivation rec {
else "-static-libgcc";
# TODO(@Ericson2314): Always pass "--target" and always prefix.
configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
configurePlatforms = stdenv.lib.optionals (targetPlatform != hostPlatform) [ "build" "host" "target" ];
configureFlags =
[ "--enable-shared" "--enable-deterministic-archives" "--disable-werror" ]
++ optional (stdenv.system == "mips64el-linux") "--enable-fix-loongson2f-nop"