summary refs log tree commit diff
path: root/pkgs/os-specific
diff options
context:
space:
mode:
authorJohn Ericson <Ericson2314@yahoo.com>2017-06-30 10:12:05 -0400
committerGitHub <noreply@github.com>2017-06-30 10:12:05 -0400
commitc53449ce57f26de17532f0dea727b58db68b337e (patch)
tree120ec8dad2d1a6d1c678f3d51778328f5ad2a110 /pkgs/os-specific
parentd61c22341b00171b53697164cb8241184979d14c (diff)
parent95c8277701fb746ad4d91841de494ee869886991 (diff)
downloadnixlib-c53449ce57f26de17532f0dea727b58db68b337e.tar
nixlib-c53449ce57f26de17532f0dea727b58db68b337e.tar.gz
nixlib-c53449ce57f26de17532f0dea727b58db68b337e.tar.bz2
nixlib-c53449ce57f26de17532f0dea727b58db68b337e.tar.lz
nixlib-c53449ce57f26de17532f0dea727b58db68b337e.tar.xz
nixlib-c53449ce57f26de17532f0dea727b58db68b337e.tar.zst
nixlib-c53449ce57f26de17532f0dea727b58db68b337e.zip
Merge pull request #26881 from obsidiansystems/cross-hashbreak
Make hash-breaking cleanups avoided in #26007
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r--pkgs/os-specific/darwin/binutils/default.nix13
-rw-r--r--pkgs/os-specific/darwin/cctools/port.nix15
-rw-r--r--pkgs/os-specific/linux/busybox/default.nix6
3 files changed, 19 insertions, 15 deletions
diff --git a/pkgs/os-specific/darwin/binutils/default.nix b/pkgs/os-specific/darwin/binutils/default.nix
index f88f761f65a3..933e7558dbbf 100644
--- a/pkgs/os-specific/darwin/binutils/default.nix
+++ b/pkgs/os-specific/darwin/binutils/default.nix
@@ -2,11 +2,12 @@
 , hostPlatform, targetPlatform
 }:
 
-let
-  prefix = stdenv.lib.optionalString
-    (targetPlatform != hostPlatform)
-    "${targetPlatform.config}-";
+# Make sure both underlying packages claim to have prepended their binaries
+# with the same prefix.
+assert binutils-raw.prefix == cctools.prefix;
 
+let
+  inherit (binutils-raw) prefix;
   cmds = [
     "ar" "ranlib" "as" "dsymutil" "install_name_tool"
     "ld" "strip" "otool" "lipo" "nm" "strings" "size"
@@ -50,4 +51,8 @@ stdenv.mkDerivation {
 
     ln -s ${cctools}/libexec $out/libexec
   '';
+
+  passthru = {
+    inherit prefix;
+  };
 }
diff --git a/pkgs/os-specific/darwin/cctools/port.nix b/pkgs/os-specific/darwin/cctools/port.nix
index 222c51603fdd..9fdb00d66be9 100644
--- a/pkgs/os-specific/darwin/cctools/port.nix
+++ b/pkgs/os-specific/darwin/cctools/port.nix
@@ -1,10 +1,12 @@
 { stdenv, fetchFromGitHub, makeWrapper, autoconf, automake, libtool_2
 , llvm, libcxx, libcxxabi, clang, libuuid
 , libobjc ? null, maloader ? null, xctoolchain ? null
-, buildPlatform, hostPlatform, targetPlatform
+, hostPlatform, targetPlatform
 }:
 
 let
+  # The prefix prepended to binary names to allow multiple binuntils on the
+  # PATH to both be usable.
   prefix = stdenv.lib.optionalString
     (targetPlatform != hostPlatform)
     "${targetPlatform.config}-";
@@ -38,13 +40,10 @@ let
 
     enableParallelBuilding = true;
 
+    # TODO(@Ericson2314): Always pass "--target" and always prefix.
+    configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
     configureFlags = stdenv.lib.optionals (!stdenv.isDarwin) [
       "CXXFLAGS=-I${libcxx}/include/c++/v1"
-    ] ++ stdenv.lib.optionals (targetPlatform != buildPlatform) [
-      # TODO make unconditional next hash break
-      "--build=${buildPlatform.config}"
-      "--host=${hostPlatform.config}"
-      "--target=${targetPlatform.config}"
     ];
 
     postPatch = ''
@@ -104,6 +103,10 @@ let
         done
       '';
 
+    passthru = {
+      inherit prefix;
+    };
+
     meta = {
       homepage = "http://www.opensource.apple.com/source/cctools/";
       description = "Mac OS X Compiler Tools (cross-platform port)";
diff --git a/pkgs/os-specific/linux/busybox/default.nix b/pkgs/os-specific/linux/busybox/default.nix
index e1ea8fa8fdd2..815e2e0f6ef6 100644
--- a/pkgs/os-specific/linux/busybox/default.nix
+++ b/pkgs/os-specific/linux/busybox/default.nix
@@ -63,7 +63,7 @@ stdenv.mkDerivation rec {
     CONFIG_DEFAULT_SETFONT_DIR "/etc/kbd"
 
     ${extraConfig}
-    $extraCrossConfig
+    CONFIG_CROSS_COMPILER_PREFIX "${stdenv.cc.prefix}"
     EOF
 
     make oldconfig
@@ -79,10 +79,6 @@ stdenv.mkDerivation rec {
 
   buildInputs = lib.optionals (enableStatic && !useMusl) [ stdenv.cc.libc stdenv.cc.libc.static ];
 
-  extraCrossConfig = if hostPlatform == buildPlatform then null else ''
-    CONFIG_CROSS_COMPILER_PREFIX "${stdenv.cc.prefix}"
-  '';
-
   enableParallelBuilding = true;
 
   meta = with stdenv.lib; {