From d381e51fb567e23039f17fdf28576dd6b341911d Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sun, 12 Feb 2023 13:40:29 +0000 Subject: binutils: try to move headers around only when --host/--target differ (#215989) Without the change `pkgsMusl.pkgsStatic.buildPackages.binutils.bintools` build fails as: $ ln: failed to create symbolic link './include': File exists This happens because both host and target are `x86_64-unknown-linux-musl`. But `hostPlatform` differs from `targetPlatform` by `isStatic` value. By `./configure`'s standard it's not yet a cross-compilation. The change tries to move things around only when tuples change. --- pkgs/development/tools/misc/binutils/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix index 0d7e12a51fb..208b404f1ea 100644 --- a/pkgs/development/tools/misc/binutils/default.nix +++ b/pkgs/development/tools/misc/binutils/default.nix @@ -234,7 +234,7 @@ stdenv.mkDerivation (finalAttrs: { # $out/$host/$target/include/* to $dev/include/* # TODO(trofi): fix installation paths upstream so we could remove this # code and have "lib" output unconditionally. - postInstall = lib.optionalString (hostPlatform != targetPlatform) '' + postInstall = lib.optionalString (hostPlatform.config != targetPlatform.config) '' ln -s $out/${hostPlatform.config}/${targetPlatform.config}/lib/* $out/lib/ ln -s $out/${hostPlatform.config}/${targetPlatform.config}/include/* $dev/include/ ''; -- cgit 1.4.1