Author: eelco
Date: Sun Apr  1 22:17:00 2012
New Revision: 33531
URL: https://nixos.org/websvn/nix/?rev=33531&sc=1

Log:
* GMP updated to 5.0.4.
* By default, QEMU's CPUID identifies the CPU as GenuineIntel, family
  6, model 2.  Since there never was a physical 64-bit CPU like that,
  64-bit GMP calls abort().  This causes every program linked against
  libgmp to fail under QEMU (unless an appropriate -cpu or -M flag is
  used), which is rather bad, especially for users of hosting
  providers who cannot change QEMU's flags.  The patch causes GMP to
  be more liberal (i.e., use non-CPU-specific implementations).

Added:
   nixpkgs/branches/stdenv-updates/pkgs/development/libraries/gmp/5.0.4.nix
      - copied, changed from r33518, 
nixpkgs/trunk/pkgs/development/libraries/gmp/5.0.3.nix
   
nixpkgs/branches/stdenv-updates/pkgs/development/libraries/gmp/ignore-bad-cpuid.patch
Deleted:
   nixpkgs/branches/stdenv-updates/pkgs/development/libraries/gmp/5.0.3.nix
Modified:
   nixpkgs/branches/stdenv-updates/pkgs/top-level/all-packages.nix

Copied and modified: 
nixpkgs/branches/stdenv-updates/pkgs/development/libraries/gmp/5.0.4.nix (from 
r33518, nixpkgs/trunk/pkgs/development/libraries/gmp/5.0.3.nix)
==============================================================================
--- nixpkgs/trunk/pkgs/development/libraries/gmp/5.0.3.nix      Sun Apr  1 
14:33:23 2012        (r33518, copy source)
+++ nixpkgs/branches/stdenv-updates/pkgs/development/libraries/gmp/5.0.4.nix    
Sun Apr  1 22:17:00 2012        (r33531)
@@ -1,13 +1,15 @@
 { stdenv, fetchurl, m4, cxx ? true }:
 
 stdenv.mkDerivation rec {
-  name = "gmp-5.0.3";
+  name = "gmp-5.0.4";
 
   src = fetchurl {
     url = "mirror://gnu/gmp/${name}.tar.bz2";
-    sha256 = 
"dcafe9989c7f332b373e1f766af8e9cd790fc802fdec422a1910a6ef783480e3";
+    sha256 = "0vx0z5f1q8jjxjp8hcbcvzz8y41zs889nna4r4ahkpsb7vgamm1m";
   };
 
+  patches = [ ./ignore-bad-cpuid.patch ];
+
   buildNativeInputs = [ m4 ];
 
   configureFlags =

Added: 
nixpkgs/branches/stdenv-updates/pkgs/development/libraries/gmp/ignore-bad-cpuid.patch
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ 
nixpkgs/branches/stdenv-updates/pkgs/development/libraries/gmp/ignore-bad-cpuid.patch
       Sun Apr  1 22:17:00 2012        (r33531)
@@ -0,0 +1,31 @@
+Don't abort when seeing the default CPU model/platform returned by
+QEMU.
+
+diff -ru -x '*~' gmp-5.0.4-orig/mpn/x86_64/fat/fat.c 
gmp-5.0.4/mpn/x86_64/fat/fat.c
+--- gmp-5.0.4-orig/mpn/x86_64/fat/fat.c        2012-02-10 11:23:05.000000000 
+0100
++++ gmp-5.0.4/mpn/x86_64/fat/fat.c     2012-04-01 21:38:35.843066724 +0200
+@@ -194,13 +194,16 @@
+     {
+       switch (family)
+       {
++#if 0
+       case 4:
+       case 5:
+         abort ();             /* 32-bit processors */
++#endif
+ 
+       case 6:
+         switch (model)
+           {
++#if 0
+           case 0x00:
+           case 0x01:
+           case 0x02:
+@@ -217,6 +220,7 @@
+           case 0x0d:          /* Dothan */
+           case 0x0e:          /* Yonah */
+             abort ();         /* 32-bit processors */
++#endif
+ 
+           case 0x0f:          /* Conroe Merom Kentsfield Allendale */
+           case 0x10:

Modified: nixpkgs/branches/stdenv-updates/pkgs/top-level/all-packages.nix
==============================================================================
--- nixpkgs/branches/stdenv-updates/pkgs/top-level/all-packages.nix     Sun Apr 
 1 22:05:29 2012        (r33530)
+++ nixpkgs/branches/stdenv-updates/pkgs/top-level/all-packages.nix     Sun Apr 
 1 22:17:00 2012        (r33531)
@@ -3640,7 +3640,7 @@
       # GMP 4.3.2 is broken on Darwin, so use 4.3.1.
       callPackage ../development/libraries/gmp/4.3.1.nix { }
     else
-      callPackage ../development/libraries/gmp/5.0.3.nix { };
+      callPackage ../development/libraries/gmp/5.0.4.nix { };
 
   gmpxx = appendToName "with-cxx" (gmp.override { cxx = true; });
 
_______________________________________________
nix-commits mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-commits

Reply via email to