summary refs log tree commit diff
diff options
context:
space:
mode:
authorJohn Ericson <Ericson2314@Yahoo.com>2017-05-21 14:51:02 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2017-06-22 17:52:27 -0400
commitc4ba2e3ef691c349bcce2b1e8b76a0bcd253544c (patch)
treec83f3c3b37e42462fc7b60c8bfa39f856f569c38
parent8f970d09fe8e895b6bb7dbf52f80411a45504b19 (diff)
downloadnixpkgs-c4ba2e3ef691c349bcce2b1e8b76a0bcd253544c.tar
nixpkgs-c4ba2e3ef691c349bcce2b1e8b76a0bcd253544c.tar.gz
nixpkgs-c4ba2e3ef691c349bcce2b1e8b76a0bcd253544c.tar.bz2
nixpkgs-c4ba2e3ef691c349bcce2b1e8b76a0bcd253544c.tar.lz
nixpkgs-c4ba2e3ef691c349bcce2b1e8b76a0bcd253544c.tar.xz
nixpkgs-c4ba2e3ef691c349bcce2b1e8b76a0bcd253544c.tar.zst
nixpkgs-c4ba2e3ef691c349bcce2b1e8b76a0bcd253544c.zip
cc-wrapper: Remove `stdenv.is*` for `targetPlatform.is*`
Modify bootstrapping stdenvs to make sure `targetPlatform` also passed.
-rw-r--r--pkgs/build-support/cc-wrapper/default.nix11
-rw-r--r--pkgs/stdenv/darwin/default.nix2
-rw-r--r--pkgs/stdenv/freebsd/default.nix1
-rw-r--r--pkgs/stdenv/linux/default.nix2
-rw-r--r--pkgs/stdenv/native/default.nix1
-rw-r--r--pkgs/stdenv/nix/default.nix1
6 files changed, 13 insertions, 5 deletions
diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix
index e56f1f9a7d4..6a47836b171 100644
--- a/pkgs/build-support/cc-wrapper/default.nix
+++ b/pkgs/build-support/cc-wrapper/default.nix
@@ -10,6 +10,7 @@
 , zlib ? null, extraPackages ? [], extraBuildCommands ? ""
 , dyld ? null # TODO: should this be a setup-hook on dyld?
 , isGNU ? false, isClang ? cc.isClang or false, gnugrep ? null
+, targetPlatform
 }:
 
 with stdenv.lib;
@@ -35,7 +36,7 @@ let
   # The wrapper scripts use 'cat' and 'grep', so we may need coreutils.
   coreutils_bin = if nativeTools then "" else getBin coreutils;
 
-  default_cxx_stdlib_compile=optionalString (stdenv.isLinux && !(cc.isGNU or false))
+  default_cxx_stdlib_compile=optionalString (targetPlatform.isLinux && !(cc.isGNU or false))
     "-isystem $(echo -n ${cc.gcc}/include/c++/*) -isystem $(echo -n ${cc.gcc}/include/c++/*)/$(${cc.gcc}/bin/gcc -dumpmachine)";
 in
 
@@ -78,7 +79,7 @@ stdenv.mkDerivation {
       }
     ''
 
-    + optionalString (!nativeLibc) (if (!stdenv.isDarwin) then ''
+    + optionalString (!nativeLibc) (if (!targetPlatform.isDarwin) then ''
       dynamicLinker="${libc_lib}/lib/$dynamicLinker"
       echo $dynamicLinker > $out/nix-support/dynamic-linker
 
@@ -117,7 +118,7 @@ stdenv.mkDerivation {
     ''
 
     + (if nativeTools then ''
-      ccPath="${if stdenv.isDarwin then cc else nativePrefix}/bin"
+      ccPath="${if targetPlatform.isDarwin then cc else nativePrefix}/bin"
       ldPath="${nativePrefix}/bin"
     '' else ''
       echo $cc > $out/nix-support/orig-cc
@@ -166,7 +167,7 @@ stdenv.mkDerivation {
       echo ${toString extraPackages} > $out/nix-support/propagated-native-build-inputs
     ''
 
-    + optionalString (stdenv.isSunOS && nativePrefix != "") ''
+    + optionalString (targetPlatform.isSunOS && nativePrefix != "") ''
       # Solaris needs an additional ld wrapper.
       ldPath="${nativePrefix}/bin"
       exec="$ldPath/ld"
@@ -271,7 +272,7 @@ stdenv.mkDerivation {
       (if stdenv.system == "i686-linux" then "ld-linux.so.2" else
        if stdenv.system == "x86_64-linux" then "ld-linux-x86-64.so.2" else
        # ARM with a wildcard, which can be "" or "-armhf".
-       if stdenv.isArm then "ld-linux*.so.3" else
+       if targetPlatform.isArm32 then "ld-linux*.so.3" else
        if stdenv.system == "aarch64-linux" then "ld-linux-aarch64.so.1" else
        if stdenv.system == "powerpc-linux" then "ld.so.1" else
        if stdenv.system == "mips64el-linux" then "ld.so.1" else
diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix
index fba5afd4f6e..1592426b6e3 100644
--- a/pkgs/stdenv/darwin/default.nix
+++ b/pkgs/stdenv/darwin/default.nix
@@ -73,6 +73,7 @@ in rec {
           nativeTools  = true;
           nativePrefix = bootstrapTools;
           nativeLibc   = false;
+          targetPlatform = localSystem;
           libc         = last.pkgs.darwin.Libsystem;
           isClang      = true;
           cc           = { name = "clang-9.9.9"; outPath = bootstrapTools; };
@@ -295,6 +296,7 @@ in rec {
       inherit shell;
       nativeTools = false;
       nativeLibc  = false;
+      targetPlatform = localSystem;
       inherit (pkgs) coreutils binutils gnugrep;
       inherit (pkgs.darwin) dyld;
       cc   = pkgs.llvmPackages.clang-unwrapped;
diff --git a/pkgs/stdenv/freebsd/default.nix b/pkgs/stdenv/freebsd/default.nix
index 474a467e90c..20be86e5f96 100644
--- a/pkgs/stdenv/freebsd/default.nix
+++ b/pkgs/stdenv/freebsd/default.nix
@@ -77,6 +77,7 @@ let inherit (localSystem) system; in
         nativeTools  = true;
         nativePrefix = "/usr";
         nativeLibc   = true;
+        targetPlatform = localSystem;
         inherit (prevStage) stdenv;
         cc           = {
           name    = "clang-9.9.9";
diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix
index b3399cc29b3..b23d1cd0173 100644
--- a/pkgs/stdenv/linux/default.nix
+++ b/pkgs/stdenv/linux/default.nix
@@ -76,6 +76,7 @@ let
              else lib.makeOverridable (import ../../build-support/cc-wrapper) {
           nativeTools = false;
           nativeLibc = false;
+          targetPlatform = localSystem;
           cc = prevStage.gcc-unwrapped;
           isGNU = true;
           libc = prevStage.glibc;
@@ -239,6 +240,7 @@ in
         nativeTools = false;
         nativeLibc = false;
         isGNU = true;
+        targetPlatform = localSystem;
         cc = prevStage.gcc-unwrapped;
         libc = self.glibc;
         inherit (self) stdenv binutils coreutils gnugrep;
diff --git a/pkgs/stdenv/native/default.nix b/pkgs/stdenv/native/default.nix
index 77c868a02f8..3bcd0687bc6 100644
--- a/pkgs/stdenv/native/default.nix
+++ b/pkgs/stdenv/native/default.nix
@@ -125,6 +125,7 @@ in
         "i686-solaris" = "/usr/gnu";
         "x86_64-solaris" = "/opt/local/gcc47";
       }.${system} or "/usr";
+      targetPlatform = localSystem;
       inherit stdenv;
     };
 
diff --git a/pkgs/stdenv/nix/default.nix b/pkgs/stdenv/nix/default.nix
index ef088ecbf64..2363fb966e7 100644
--- a/pkgs/stdenv/nix/default.nix
+++ b/pkgs/stdenv/nix/default.nix
@@ -30,6 +30,7 @@ bootStages ++ [
         nativeTools = false;
         nativePrefix = stdenv.lib.optionalString hostPlatform.isSunOS "/usr";
         nativeLibc = true;
+        targetPlatform = localSystem;
         inherit stdenv;
         inherit (prevStage) binutils coreutils gnugrep;
         cc = prevStage.gcc.cc;