From e98814461d40c2907a46bbd7a81f8e0b7053019e Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 10 May 2018 17:42:48 -0400 Subject: [PATCH] glibc: Remove old-style nullable "cross" variable Much better to just use {build,host}Platform directly. --- .../development/libraries/glibc/common-2.27.nix | 17 +++++++---------- pkgs/development/libraries/glibc/common.nix | 15 +++++---------- 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;