git.iko.soy/typeable/nixpkgs
on master help sign in
glibc: Remove old-style nullable "cross" variable

Much better to just use {build,host}Platform directly.

commite98814461d40c2907a46bbd7a81f8e0b7053019e authorJohn Ericson <John.Ericson@Obsidian.Systems> dateThu 10 May 2018, 17:42 (9 years ago) parent1fe81a4
2 files changed+12−20
pkgs/development/libraries/glibc/common-2.27.nix+7−10 pkgs/development/libraries/glibc/common.nix+5−10
pkgs/development/libraries/glibc/common-2.27.nix+7−10
@@ -23,7 +23,6 @@ let
2323 version = "2.27";
2424 patchSuffix = "";
2525 sha256 = "0wpwq7gsm7sd6ysidv0z575ckqdg13cr2njyfgrbgh4f65adwwji";
26− cross = if buildPlatform != hostPlatform then hostPlatform else null;
2726in
2827
2928assert withLinuxHeaders -> linuxHeaders != null;
@@ -33,9 +32,6 @@ stdenv.mkDerivation ({
3332 inherit installLocales;
3433 linuxHeaders = if withLinuxHeaders then linuxHeaders else null;
3534
36− # The host/target system.
37− crossConfig = if cross != null then cross.config else null;
38−
3935 inherit (stdenv) is64bit;
4036
4137 enableParallelBuilding = true;
@@ -106,11 +102,12 @@ stdenv.mkDerivation ({
106102 else "--disable-profile")
107103 ] ++ lib.optionals withLinuxHeaders [
108104 "--enable-kernel=3.2.0" # can't get below with glibc >= 2.26
109− ] ++ lib.optionals (cross != null) [
110− (if cross ? float && cross.float == "soft" then "--without-fp" else "--with-fp")
111− ] ++ lib.optionals (cross != null) [
105+ ] ++ lib.optionals (hostPlatform != buildPlatform) [
106+ (if hostPlatform.platform.gcc.float or (hostPlatform.parsed.abi.float or "hard") == "soft"
107+ then "--without-fp"
108+ else "--with-fp")
112109 "--with-__thread"
113− ] ++ lib.optionals (cross == null && stdenv.isAarch32) [
110+ ] ++ lib.optionals (hostPlatform == buildPlatform && hostPlatform.isAarch32) [
114111 "--host=arm-linux-gnueabi"
115112 "--build=arm-linux-gnueabi"
116113
@@ -162,7 +159,7 @@ stdenv.mkDerivation ({
162159 }
163160
164161
165− '' + lib.optionalString (cross != null) ''
162+ '' + lib.optionalString (hostPlatform != buildPlatform) ''
166163 sed -i s/-lgcc_eh//g "../$sourceRoot/Makeconfig"
167164
168165 cat > config.cache << "EOF"
@@ -196,7 +193,7 @@ stdenv.mkDerivation ({
196193 passthru = { inherit version; };
197194}
198195
199−// lib.optionalAttrs (cross != null) {
196+// lib.optionalAttrs (hostPlatform != buildPlatform) {
200197 preInstall = null; # clobber the native hook
201198
202199 dontStrip = true;
pkgs/development/libraries/glibc/common.nix+5−10
@@ -22,7 +22,6 @@ let
2222 version = "2.26";
2323 patchSuffix = "-131";
2424 sha256 = "1ggnj1hzjym7sn93rbwydcqd562q73lsb7g7kd199g6j9j9hlkp5";
25− cross = if buildPlatform != hostPlatform then hostPlatform else null;
2625in
2726
2827assert withLinuxHeaders -> linuxHeaders != null;
@@ -32,9 +31,6 @@ stdenv.mkDerivation ({
3231 inherit installLocales;
3332 linuxHeaders = if withLinuxHeaders then linuxHeaders else null;
3433
35− # The host/target system.
36− crossConfig = if cross != null then cross.config else null;
37−
3834 inherit (stdenv) is64bit;
3935
4036 enableParallelBuilding = true;
@@ -126,13 +122,12 @@ stdenv.mkDerivation ({
126122 else "--disable-profile")
127123 ] ++ lib.optionals withLinuxHeaders [
128124 "--enable-kernel=3.2.0" # can't get below with glibc >= 2.26
129− ] ++ lib.optionals (cross != null) [
130− (if cross.platform.gcc.float or (cross.parsed.abi.float or "hard") == "soft"
125+ ] ++ lib.optionals (hostPlatform != buildPlatform) [
126+ (if hostPlatform.platform.gcc.float or (hostPlatform.parsed.abi.float or "hard") == "soft"
131127 then "--without-fp"
132128 else "--with-fp")
133− ] ++ lib.optionals (cross != null) [
134129 "--with-__thread"
135− ] ++ lib.optionals (cross == null && stdenv.isAarch32) [
130+ ] ++ lib.optionals (hostPlatform == buildPlatform && hostPlatform.isAarch32) [
136131 "--host=arm-linux-gnueabi"
137132 "--build=arm-linux-gnueabi"
138133
@@ -183,7 +178,7 @@ stdenv.mkDerivation ({
183178 }
184179
185180
186− '' + lib.optionalString (cross != null) ''
181+ '' + lib.optionalString (hostPlatform != buildPlatform) ''
187182 sed -i s/-lgcc_eh//g "../$sourceRoot/Makeconfig"
188183
189184 cat > config.cache << "EOF"
@@ -215,7 +210,7 @@ stdenv.mkDerivation ({
215210 } // meta;
216211}
217212
218−// lib.optionalAttrs (cross != null) {
213+// lib.optionalAttrs (hostPlatform != buildPlatform) {
219214 preInstall = null; # clobber the native hook
220215
221216 dontStrip = true;