diff options
author | Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> | 2015-06-12 10:33:59 +0300 |
---|---|---|
committer | Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> | 2015-06-13 11:30:29 +0300 |
commit | c240556a24f6e358992a0c7169592c2ccc3c4e60 (patch) | |
tree | 117efa7dac26057f1f4a70e5675a54965572ecb0 /pkgs/development/libraries | |
parent | 33e70ad68a13efc14187a0657d447c26cf765cb7 (diff) |
gmp: Fix build on ARM
The config.guess script tries to detect various ARM optimization flags via /proc/cpuinfo. This is not only impure, but the detection is also broken on multicore machines; on my quad-core system the machine type is autodetected as 'neon neon neon neon-unknown-linux-gnueabihf': checking build system type... Invalid configuration `neon': machine `neon' not recognized configure: error: /nix/store/bafimhdj1yaxj6m1hvq7wvhwwizc939x-bootstrap-tools/bin/sh ./config.sub neon neon neon neon-unknown-linux-gnueabihf failed builder for ‘/nix/store/1npm2358bpvclj5w7fqjjwg72vbb0d79-gmp-6.0.0a.drv’ failed with exit code 1 Override the system type with the output of GNU config.guess to avoid the autodetection.
Diffstat (limited to 'pkgs/development/libraries')
-rw-r--r-- | pkgs/development/libraries/gmp/5.1.x.nix | 9 | ||||
-rw-r--r-- | pkgs/development/libraries/gmp/6.x.nix | 9 |
2 files changed, 16 insertions, 2 deletions
diff --git a/pkgs/development/libraries/gmp/5.1.x.nix b/pkgs/development/libraries/gmp/5.1.x.nix index 0df1a4f8cd836..7b393067ff525 100644 --- a/pkgs/development/libraries/gmp/5.1.x.nix +++ b/pkgs/development/libraries/gmp/5.1.x.nix @@ -1,6 +1,6 @@ { stdenv, fetchurl, m4, cxx ? true, withStatic ? true }: -with { inherit (stdenv.lib) optional; }; +with { inherit (stdenv.lib) optional optionalString; }; stdenv.mkDerivation rec { name = "gmp-5.1.3"; @@ -28,6 +28,13 @@ stdenv.mkDerivation rec { ++ optional stdenv.is64bit "--with-pic" ; + # The config.guess in GMP tries to runtime-detect various + # ARM optimization flags via /proc/cpuinfo (and is also + # broken on multicore CPUs). Avoid this impurity. + preConfigure = optionalString stdenv.isArm '' + configureFlagsArray+=("--build=$(./configfsf.guess)") + ''; + doCheck = true; dontDisableStatic = withStatic; diff --git a/pkgs/development/libraries/gmp/6.x.nix b/pkgs/development/libraries/gmp/6.x.nix index b7350c19960ac..171611e124986 100644 --- a/pkgs/development/libraries/gmp/6.x.nix +++ b/pkgs/development/libraries/gmp/6.x.nix @@ -1,6 +1,6 @@ { stdenv, fetchurl, m4, cxx ? true, withStatic ? true }: -with { inherit (stdenv.lib) optional; }; +with { inherit (stdenv.lib) optional optionalString; }; stdenv.mkDerivation rec { name = "gmp-6.0.0a"; @@ -26,6 +26,13 @@ stdenv.mkDerivation rec { ++ optional stdenv.is64bit "--with-pic" ; + # The config.guess in GMP tries to runtime-detect various + # ARM optimization flags via /proc/cpuinfo (and is also + # broken on multicore CPUs). Avoid this impurity. + preConfigure = optionalString stdenv.isArm '' + configureFlagsArray+=("--build=$(./configfsf.guess)") + ''; + doCheck = true; dontDisableStatic = withStatic; |