summary refs log tree commit diff
path: root/pkgs/development/libraries/glibc
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2018-05-10 17:42:48 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2018-05-10 18:05:08 -0400
commite98814461d40c2907a46bbd7a81f8e0b7053019e (patch)
treee44c58f84571d9ace7f1b24a3c962cee69170ba1 /pkgs/development/libraries/glibc
parent1fe81a4bcd25dba9319bc1bb49b078872f28ffa6 (diff)
downloadnixpkgs-e98814461d40c2907a46bbd7a81f8e0b7053019e.tar
nixpkgs-e98814461d40c2907a46bbd7a81f8e0b7053019e.tar.gz
nixpkgs-e98814461d40c2907a46bbd7a81f8e0b7053019e.tar.bz2
nixpkgs-e98814461d40c2907a46bbd7a81f8e0b7053019e.tar.lz
nixpkgs-e98814461d40c2907a46bbd7a81f8e0b7053019e.tar.xz
nixpkgs-e98814461d40c2907a46bbd7a81f8e0b7053019e.tar.zst
nixpkgs-e98814461d40c2907a46bbd7a81f8e0b7053019e.zip
glibc: Remove old-style nullable "cross" variable
Much better to just use {build,host}Platform directly.
Diffstat (limited to 'pkgs/development/libraries/glibc')
-rw-r--r--pkgs/development/libraries/glibc/common-2.27.nix17
-rw-r--r--pkgs/development/libraries/glibc/common.nix15
2 files changed, 12 insertions, 20 deletions
diff --git a/pkgs/development/libraries/glibc/common-2.27.nix b/pkgs/development/libraries/glibc/common-2.27.nix
index 272e18905c1..7d2cf7d14b7 100644
--- a/pkgs/development/libraries/glibc/common-2.27.nix
+++ b/pkgs/development/libraries/glibc/common-2.27.nix
@@ -23,7 +23,6 @@ let
   version = "2.27";
   patchSuffix = "";
   sha256 = "0wpwq7gsm7sd6ysidv0z575ckqdg13cr2njyfgrbgh4f65adwwji";
-  cross = if buildPlatform != hostPlatform then hostPlatform else null;
 in
 
 assert withLinuxHeaders -> linuxHeaders != null;
@@ -33,9 +32,6 @@ stdenv.mkDerivation ({
   inherit  installLocales;
   linuxHeaders = if withLinuxHeaders then linuxHeaders else null;
 
-  # The host/target system.
-  crossConfig = if cross != null then cross.config else null;
-
   inherit (stdenv) is64bit;
 
   enableParallelBuilding = true;
@@ -106,11 +102,12 @@ stdenv.mkDerivation ({
        else "--disable-profile")
     ] ++ lib.optionals withLinuxHeaders [
       "--enable-kernel=3.2.0" # can't get below with glibc >= 2.26
-    ] ++ lib.optionals (cross != null) [
-      (if cross ? float && cross.float == "soft" then "--without-fp" else "--with-fp")
-    ] ++ lib.optionals (cross != null) [
+    ] ++ lib.optionals (hostPlatform != buildPlatform) [
+      (if hostPlatform.platform.gcc.float or (hostPlatform.parsed.abi.float or "hard") == "soft"
+       then "--without-fp"
+       else "--with-fp")
       "--with-__thread"
-    ] ++ lib.optionals (cross == null && stdenv.isAarch32) [
+    ] ++ lib.optionals (hostPlatform == buildPlatform && hostPlatform.isAarch32) [
       "--host=arm-linux-gnueabi"
       "--build=arm-linux-gnueabi"
 
@@ -162,7 +159,7 @@ stdenv.mkDerivation ({
     }
 
 
-  '' + lib.optionalString (cross != null) ''
+  '' + lib.optionalString (hostPlatform != buildPlatform) ''
     sed -i s/-lgcc_eh//g "../$sourceRoot/Makeconfig"
 
     cat > config.cache << "EOF"
@@ -196,7 +193,7 @@ stdenv.mkDerivation ({
   passthru = { inherit version; };
 }
 
-// lib.optionalAttrs (cross != null) {
+// lib.optionalAttrs (hostPlatform != buildPlatform) {
   preInstall = null; # clobber the native hook
 
   dontStrip = true;
diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix
index 0e363fe4a25..a1c3a90162e 100644
--- a/pkgs/development/libraries/glibc/common.nix
+++ b/pkgs/development/libraries/glibc/common.nix
@@ -22,7 +22,6 @@ let
   version = "2.26";
   patchSuffix = "-131";
   sha256 = "1ggnj1hzjym7sn93rbwydcqd562q73lsb7g7kd199g6j9j9hlkp5";
-  cross = if buildPlatform != hostPlatform then hostPlatform else null;
 in
 
 assert withLinuxHeaders -> linuxHeaders != null;
@@ -32,9 +31,6 @@ stdenv.mkDerivation ({
   inherit  installLocales;
   linuxHeaders = if withLinuxHeaders then linuxHeaders else null;
 
-  # The host/target system.
-  crossConfig = if cross != null then cross.config else null;
-
   inherit (stdenv) is64bit;
 
   enableParallelBuilding = true;
@@ -126,13 +122,12 @@ stdenv.mkDerivation ({
        else "--disable-profile")
     ] ++ lib.optionals withLinuxHeaders [
       "--enable-kernel=3.2.0" # can't get below with glibc >= 2.26
-    ] ++ lib.optionals (cross != null) [
-      (if cross.platform.gcc.float or (cross.parsed.abi.float or "hard") == "soft"
+    ] ++ lib.optionals (hostPlatform != buildPlatform) [
+      (if hostPlatform.platform.gcc.float or (hostPlatform.parsed.abi.float or "hard") == "soft"
        then "--without-fp"
        else "--with-fp")
-    ] ++ lib.optionals (cross != null) [
       "--with-__thread"
-    ] ++ lib.optionals (cross == null && stdenv.isAarch32) [
+    ] ++ lib.optionals (hostPlatform == buildPlatform && hostPlatform.isAarch32) [
       "--host=arm-linux-gnueabi"
       "--build=arm-linux-gnueabi"
 
@@ -183,7 +178,7 @@ stdenv.mkDerivation ({
     }
 
 
-  '' + lib.optionalString (cross != null) ''
+  '' + lib.optionalString (hostPlatform != buildPlatform) ''
     sed -i s/-lgcc_eh//g "../$sourceRoot/Makeconfig"
 
     cat > config.cache << "EOF"
@@ -215,7 +210,7 @@ stdenv.mkDerivation ({
   } // meta;
 }
 
-// lib.optionalAttrs (cross != null) {
+// lib.optionalAttrs (hostPlatform != buildPlatform) {
   preInstall = null; # clobber the native hook
 
   dontStrip = true;