From 51179c6e888b03ae3b42f67e2bc85ca0112d7677 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 18 Sep 2017 18:56:03 -0400 Subject: [PATCH 1/3] stdenv: Add back leading '-' in cross derivation name suffix I messed this up when I moved the logic from `makeStdenvCross` in e826a6a24774. --- pkgs/stdenv/generic/make-derivation.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 23a77719fa0..eb8545c6999 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -97,7 +97,7 @@ rec { { name = name + lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) - stdenv.hostPlatform.config; + ("-" + stdenv.hostPlatform.config); builder = attrs.realBuilder or stdenv.shell; args = attrs.args or ["-e" (attrs.builder or ./default-builder.sh)]; inherit stdenv; From a44bbc72e6b3d7c3e9619e5c74de6b6261a8e4c8 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 18 Sep 2017 19:22:22 -0400 Subject: [PATCH 2/3] cc-wrapper: Remove obsolete assertion This was just causing evaluation problems on cross. --- pkgs/build-support/cc-wrapper/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index 0114170b8eb..4bbd6c205e5 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -21,8 +21,6 @@ assert !nativeTools -> assert !(nativeLibc && noLibc); assert (noLibc || nativeLibc) == (libc == null); -assert stdenv.targetPlatform != stdenv.hostPlatform -> runCommand != null; - # For ghdl (the vhdl language provider to gcc) we need zlib in the wrapper. assert cc.langVhdl or false -> zlib != null; From 13fc982e650381c6ca5a76470ae1d23abbc000ab Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 18 Sep 2017 19:23:50 -0400 Subject: [PATCH 3/3] cc-wrapper: Use same dynamic loader on all Darwin, not just x86_64 In practice, this is correct because iOS is on ARM and puts the loader there. --- pkgs/build-support/cc-wrapper/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index 4bbd6c205e5..999faf756ed 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -64,11 +64,11 @@ let else if targetPlatform.system == "i686-linux" then "${libc_lib}/lib/ld-linux.so.2" else if targetPlatform.system == "x86_64-linux" then "${libc_lib}/lib/ld-linux-x86-64.so.2" # ARM with a wildcard, which can be "" or "-armhf". - else if targetPlatform.isArm then "${libc_lib}/lib/ld-linux*.so.3" + else if (with targetPlatform; isArm && isLinux) then "${libc_lib}/lib/ld-linux*.so.3" else if targetPlatform.system == "aarch64-linux" then "${libc_lib}/lib/ld-linux-aarch64.so.1" else if targetPlatform.system == "powerpc-linux" then "${libc_lib}/lib/ld.so.1" else if targetPlatform.system == "mips64el-linux" then "${libc_lib}/lib/ld.so.1" - else if targetPlatform.system == "x86_64-darwin" then "/usr/lib/dyld" + else if targetPlatform.isDarwin then "/usr/lib/dyld" else if stdenv.lib.hasSuffix "pc-gnu" targetPlatform.config then "ld.so.1" else null;