diff --git a/gmp-5.0.5-remove-cpuid-abort.diff b/gmp-5.0.5-remove-cpuid-abort.diff new file mode 100644 index 0000000..2363ae6 --- /dev/null +++ b/gmp-5.0.5-remove-cpuid-abort.diff @@ -0,0 +1,98 @@ + +# HG changeset patch +# User Marco Bodrato +# Date 1338104524 -7200 +# Node ID ffdad0cda019a912c0cbb4e159595c34a176139f +# Parent 5e296f996b87f5bd747fc7075313911b42494d1e +mpn/x86_64/fat/fat.c: abort iff longmode-capable-bit is turned off. + +diff -r 5e296f996b87 -r ffdad0cda019 mpn/x86_64/fat/fat.c +--- a/mpn/x86_64/fat/fat.c Thu May 24 14:26:27 2012 +0200 ++++ b/mpn/x86_64/fat/fat.c Sun May 27 09:42:04 2012 +0200 +@@ -1,4 +1,4 @@ +-/* x86 fat binary initializers. ++/* x86_64 fat binary initializers. + + Contributed to the GNU project by Kevin Ryde (original x86_32 code) and + Torbjorn Granlund (port to x86_64) +@@ -7,7 +7,7 @@ + THEY'RE ALMOST CERTAIN TO BE SUBJECT TO INCOMPATIBLE CHANGES OR DISAPPEAR + COMPLETELY IN FUTURE GNU MP RELEASES. + +-Copyright 2003, 2004, 2009, 2011 Free Software Foundation, Inc. ++Copyright 2003, 2004, 2009, 2011, 2012 Free Software Foundation, Inc. + + This file is part of the GNU MP Library. + +@@ -187,6 +187,11 @@ + family = ((fms >> 8) & 0xf) + ((fms >> 20) & 0xff); + model = ((fms >> 4) & 0xf) + ((fms >> 12) & 0xf0); + ++ /* Check extended feature flags */ ++ __gmpn_cpuid (dummy_string, 0x80000001); ++ if ((dummy_string[4 + 29 / 8] & (1 << (29 - 3 * 8))) == 0) ++ abort (); /* longmode-capable-bit turned off! */ ++ + /*********************************************************/ + /*** WARNING: keep this list in sync with config.guess ***/ + /*********************************************************/ +@@ -194,30 +199,9 @@ + { + switch (family) + { +- case 4: +- case 5: +- abort (); /* 32-bit processors */ +- + case 6: + switch (model) + { +- case 0x00: +- case 0x01: +- case 0x02: +- case 0x03: +- case 0x04: +- case 0x05: +- case 0x06: +- case 0x07: +- case 0x08: +- case 0x09: /* Banias */ +- case 0x0a: +- case 0x0b: +- case 0x0c: +- case 0x0d: /* Dothan */ +- case 0x0e: /* Yonah */ +- abort (); /* 32-bit processors */ +- + case 0x0f: /* Conroe Merom Kentsfield Allendale */ + case 0x10: + case 0x11: +@@ -276,10 +260,6 @@ + { + switch (family) + { +- case 5: +- case 6: +- abort (); +- + case 15: /* k8 */ + case 16: /* k10 */ + /* CPUVEC_SETUP_athlon */ +@@ -290,14 +270,9 @@ + { + switch (family) + { +- case 5: +- abort (); /* 32-bit processors */ +- + case 6: +- if (model < 15) +- abort (); /* 32-bit processors */ +- +- CPUVEC_SETUP_nano; ++ if (model >= 15) ++ CPUVEC_SETUP_nano; + break; + } + } + diff --git a/gmp-support-kvm.diff b/gmp-support-kvm.diff deleted file mode 100644 index 984363b..0000000 --- a/gmp-support-kvm.diff +++ /dev/null @@ -1,36 +0,0 @@ -From: Stephan Kulow , Bernhard M. Wiedemann - -KVM defaults to a basically non-existant CPUid, so it needs special -handling model 1 is Pentium Pro (1995) and model 3 is Pentium II (1997), -model 2 was never released - -Index: gmp-5.0.5/mpn/x86_64/fat/fat.c -=================================================================== ---- gmp-5.0.5.orig/mpn/x86_64/fat/fat.c -+++ gmp-5.0.5/mpn/x86_64/fat/fat.c -@@ -201,9 +201,12 @@ __gmpn_cpuvec_init (void) - case 6: - switch (model) - { -+ case 0x02: /* KVM default */ -+ /* generic will do */ -+ break; -+ - case 0x00: - case 0x01: -- case 0x02: - case 0x03: - case 0x04: - case 0x05: -@@ -276,8 +279,10 @@ __gmpn_cpuvec_init (void) - { - switch (family) - { -- case 5: - case 6: -+ if(model == 2) /* KVM default */ -+ break; /* generic will do */ -+ case 5: - abort (); - - case 15: /* k8 */ diff --git a/gmp.changes b/gmp.changes index 51a13f8..7dc1897 100644 --- a/gmp.changes +++ b/gmp.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Jul 4 08:53:30 UTC 2012 - rguenther@suse.com + +- Pick fix for the aborts from CPU detection code from the upstream + branch. [bnc#671262] + ------------------------------------------------------------------- Tue Jul 3 07:49:57 UTC 2012 - bwiedemann@suse.com diff --git a/gmp.spec b/gmp.spec index 43d8364..9c7e5f3 100644 --- a/gmp.spec +++ b/gmp.spec @@ -31,7 +31,7 @@ Url: http://gmplib.org/ Source: gmp-%{version}.tar.bz2 Source2: baselibs.conf Patch0: gmp-noexec.diff -Patch1: gmp-support-kvm.diff +Patch1: gmp-5.0.5-remove-cpuid-abort.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build %description