[gmp-ecm] 01/01: RC bug fix 793012 -- faulty assembly on mips[el] arch

Jerome Benoit calculus-guest at moszumanska.debian.org
Tue Oct 20 20:04:32 UTC 2015


This is an automated email from the git hooks/post-receive script.

calculus-guest pushed a commit to branch master
in repository gmp-ecm.

commit da23a847db1ddfc6eddb243d914cefe5bb36c587
Author: Jerome Benoit <calculus at rezozer.net>
Date:   Tue Oct 20 22:03:31 2015 +0200

    RC bug fix 793012 -- faulty assembly on mips[el] arch
---
 debian/changelog                                   |  8 ++++
 debian/patches/series                              |  1 +
 .../upstream-bug-793012-mips_longlong_sp.patch     | 46 ++++++++++++++++++++++
 3 files changed, 55 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 6a12320..3d9488d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+gmp-ecm (6.4.4+ds-3) UNRELEASE; urgency=medium
+
+  * RC bug fix release (Closes: 793012), fix fault assembly code fr mips[el] arch;
+    thanks to Jurica Stanojkovic <Jurica.Stanojkovic at imgtec.com> for providing
+    the patch.
+
+ -- Jerome Benoit <calculus at rezozer.net>  Tue, 20 Oct 2015 20:03:49 +0000
+
 gmp-ecm (6.4.4+ds-2) unstable; urgency=medium
 
   * RC bug fix release (Closes: 792549), stabilize libdev transition.
diff --git a/debian/patches/series b/debian/patches/series
index 91930ed..6ad90fa 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
+upstream-bug-793012-mips_longlong_sp.patch
 upstream-autotoolization-refresh.patch
 #upstream-libtoolization-version_script.patch
 upstream-autotoolization-noexecstack.patch
diff --git a/debian/patches/upstream-bug-793012-mips_longlong_sp.patch b/debian/patches/upstream-bug-793012-mips_longlong_sp.patch
new file mode 100644
index 0000000..3b85d1c
--- /dev/null
+++ b/debian/patches/upstream-bug-793012-mips_longlong_sp.patch
@@ -0,0 +1,46 @@
+Description: upstream -- RC bug fix 793012 -- faulty assembly on mips[el] arch
+ Patch provided by Jurica Stanojkovic <Jurica.Stanojkovic at imgtec.com> :
+ the first part of patch is taken from upstream (file longlong.h); [...]
+ a second part (file sp.h) [had to be added] in order to build package
+ successfully. (The patch tested with 'gcc (Debian 5.2.1-22) 5.2.1 20151010' on
+ both mips and mipsel Debain porterboxes (and commented) on behalf of the
+ Debian Science Team by Jerome Benoit <calculus at rezozer.net>).
+Origin: debian
+Author: Jurica Stanojkovic <Jurica.Stanojkovic at imgtec.com>
+Last-Update: 2015-10-20
+
+--- gmp-ecm-6.4.4+ds.orig/longlong.h
++++ gmp-ecm-6.4.4+ds/longlong.h
+@@ -931,10 +931,19 @@ extern UWtype __MPN(udiv_qrnnd) _PROTO (
+ #endif /* __m88000__ */
+ 
+ #if defined (__mips) && W_TYPE_SIZE == 32
+-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
++#if __GMP_GNUC_PREREQ (4,4)
++ #define umul_ppmm(w1, w0, u, v) \
++   do {                                                                  \
++     UDItype __ll = (UDItype)(u) * (v);                                  \
++     w1 = __ll >> 32;                                                    \
++     w0 = __ll;                                                          \
++   } while (0)
++#endif
++#if !defined (umul_ppmm) && __GMP_GNUC_PREREQ (2,7)
+ #define umul_ppmm(w1, w0, u, v) \
+   __asm__ ("multu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v))
+-#else
++#endif
++#if !defined (umul_ppmm)
+ #define umul_ppmm(w1, w0, u, v) \
+   __asm__ ("multu %2,%3\n\tmflo %0\n\tmfhi %1"				\
+ 	   : "=d" (w0), "=d" (w1) : "d" (u), "d" (v))
+--- gmp-ecm-6.4.4+ds.orig/sp.h
++++ gmp-ecm-6.4.4+ds/sp.h
+@@ -69,7 +69,7 @@ extern size_t MPZSPV_NORMALISE_STRIDE;
+  * note that a small prime must be the size of a GMP limb */
+ typedef mp_limb_t UWtype;
+ typedef unsigned int UHWtype;
+-#if (defined(_PA_RISC1_1) && defined(__GNUC__))
++#if ((defined(_PA_RISC1_1) || defined(__mips)) && defined(__GNUC__))
+ /* this seems to be needed, otherwise umul_ppmm() does not work properly */
+ typedef mp_limb_t USItype __attribute__ ((mode (SI)));
+ typedef mp_limb_t UDItype __attribute__ ((mode (DI)));

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/gmp-ecm.git



More information about the debian-science-commits mailing list