Skip to content

Commit

Permalink
binutils: Don't pass --host etc. when not cross-compiling
Browse files Browse the repository at this point in the history
Or linuxHeaders build fails on ARM (non-cross) since e826a6a:

````
  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
````
  • Loading branch information
dezgeg committed Aug 17, 2017
1 parent d8bea24 commit 88efc22
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkgs/development/tools/misc/binutils/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

3 comments on commit 88efc22

@Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented on 88efc22 Aug 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dezgeg Please ping me for things like this---this will break build != host == target builds. #26805 I change linuxHeaders to use the build->build c-compiler (HOSTCC In Linux's very odd parlance) which fixes this without changing binutils.

Don't get me wrong, this is the right fix for now, but good to know so I can revert it in that PR.

@Ericson2314
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wait, this is arm non-cross. This is odd then---if the build succeeds at all the default configuration ought to be be fine.

@Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented on 88efc22 Aug 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also odd is that changed landed for quite a while---long enough for the channel to advance---so it seems highly unlike this never worked. Oh right, 32-bit arm isn't supported.

Please sign in to comment.