[gmp-ecm] New upstream release. Fix PPC64 build (bz 804330).
Jerry James
jjames at fedoraproject.org
Fri Dec 7 16:12:03 UTC 2012
commit 505b4236a90ef2109c4adb1817eaaa3eeed7d0e7
Author: Jerry James <jamesjer at betterlinux.com>
Date: Fri Dec 7 09:11:47 2012 -0700
New upstream release.
Fix PPC64 build (bz 804330).
.gitignore | 2 +-
gmp-ecm-ppc64-func-descs.patch | 119 ++++++++++++++++++++++++++++++++++++++++
gmp-ecm-thread.patch | 99 +++++++++++++++++++++++++++++++++
gmp-ecm.spec | 18 +++++-
sources | 2 +-
5 files changed, 234 insertions(+), 6 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 4331ed3..bc0dd35 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1 @@
-/ecm-6.4.2.tar.gz
+/ecm-6.4.3.tar.gz
diff --git a/gmp-ecm-ppc64-func-descs.patch b/gmp-ecm-ppc64-func-descs.patch
new file mode 100644
index 0000000..2b6b0fd
--- /dev/null
+++ b/gmp-ecm-ppc64-func-descs.patch
@@ -0,0 +1,119 @@
+This is SVN revision 1971, whose log says:
+
+ applied patch from Leif Leonhardy to make the assembly code work with
+ --enable-shared (see http://trac.sagemath.org/sage_trac/ticket/11705)
+
+Index: powerpc64/mulredc.m4
+===================================================================
+--- powerpc64/mulredc.m4 (revision 1970)
++++ powerpc64/mulredc.m4 (revision 1971)
+@@ -47,12 +47,15 @@
+
+ `include(`config.m4')'
+
++ GLOBL GSYM_PREFIX``''mulredc`'LENGTH
++ GLOBL .GSYM_PREFIX``''mulredc`'LENGTH
+
++ .section ".opd", "aw"
++ .align 3
++GSYM_PREFIX``''mulredc`'LENGTH:
++ .quad .GSYM_PREFIX``''mulredc`'LENGTH, .TOC. at tocbase, 0
++ .size GSYM_PREFIX``''mulredc`'LENGTH, 24
+
+- TEXT
+-.align 5 C powerPC 32 byte alignment
+- GLOBL GSYM_PREFIX``''mulredc`'LENGTH
+- TYPE(GSYM_PREFIX``''mulredc``''LENGTH,``function'')
+
+ C Implements multiplication and REDC for two input numbers of LENGTH words
+
+@@ -121,8 +124,10 @@
+ C r15, so only LENGTH entries are used in the stack.
+
+
+-
+-GSYM_PREFIX``''mulredc`'LENGTH:
++ TEXT
++ .align 5 C powerPC 32 byte alignment
++ TYPE(.GSYM_PREFIX``''mulredc``''LENGTH,``@function'')
++.GSYM_PREFIX``''mulredc`'LENGTH:
+ define(`S', `eval(8 * LENGTH)')dnl
+
+ C ########################################################################
+@@ -304,3 +309,6 @@
+ ldu r13, 8(r1)
+ addi r1, r1, 8
+ blr
++
++ .size .GSYM_PREFIX``''mulredc`'LENGTH, .-.GSYM_PREFIX``''mulredc`'LENGTH
++
+Index: powerpc64/mulredc_1_2.m4
+===================================================================
+--- powerpc64/mulredc_1_2.m4 (revision 1970)
++++ powerpc64/mulredc_1_2.m4 (revision 1971)
+@@ -56,12 +56,19 @@
+
+ `include(`config.m4')'
+
+- TEXT
+-.align 5 C powerPC 32 byte alignment
+ GLOBL GSYM_PREFIX``''mulredc`'LENGTH
+- TYPE(GSYM_PREFIX``''mulredc``''LENGTH,``function'')
++ GLOBL .GSYM_PREFIX``''mulredc`'LENGTH
+
++ .section ".opd", "aw"
++ .align 3
+ GSYM_PREFIX``''mulredc`'LENGTH:
++ .quad .GSYM_PREFIX``''mulredc`'LENGTH, .TOC. at tocbase, 0
++ .size GSYM_PREFIX``''mulredc`'LENGTH, 24
++
++ TEXT
++ .align 5 C powerPC 32 byte alignment
++ TYPE(.GSYM_PREFIX``''mulredc``''LENGTH,``@function'')
++.GSYM_PREFIX``''mulredc`'LENGTH:
+ ifelse(eval(LENGTH),1,
+ ` mulld r8, r4, r5 C x*y low half T0
+ mulhdu r9, r4, r5 C x*y high half T1
+@@ -141,3 +148,6 @@
+ ldu r13, 8(r1)
+ addi r1, r1, 8
+ blr')
++
++ .size .GSYM_PREFIX``''mulredc`'LENGTH, .-.GSYM_PREFIX``''mulredc`'LENGTH
++
+Index: powerpc64/redc.asm
+===================================================================
+--- powerpc64/redc.asm (revision 1970)
++++ powerpc64/redc.asm (revision 1971)
+@@ -40,12 +40,21 @@
+ dnl')
+
+ include(`config.m4')
+- TEXT
+- GLOBL GSYM_PREFIX`'ecm_redc3
+- TYPE(GSYM_PREFIX`'ecm_redc3,`function')
+
++ GLOBL GSYM_PREFIX`'ecm_redc3
++ GLOBL .GSYM_PREFIX`'ecm_redc3
++
++ .section ".opd", "aw"
++ .align 3
+ GSYM_PREFIX`'ecm_redc3:
++ .quad .GSYM_PREFIX`'ecm_redc3, .TOC. at tocbase, 0
++ .size GSYM_PREFIX`'ecm_redc3, 24
+
++ TEXT
++ .align 5 C 32 byte alignment
++ TYPE(.GSYM_PREFIX`'ecm_redc3,`@function')
++.GSYM_PREFIX`'ecm_redc3:
++
+ cmpdi r5, 1 C length = 1?
+ bne 1f
+
+@@ -318,3 +327,6 @@
+ addi r1, r1, 16 C restore stack ptr
+ mtlr r0
+ blr
++
++ .size .GSYM_PREFIX`'ecm_redc3, .-.GSYM_PREFIX`'ecm_redc3
++
diff --git a/gmp-ecm-thread.patch b/gmp-ecm-thread.patch
new file mode 100644
index 0000000..3247c1e
--- /dev/null
+++ b/gmp-ecm-thread.patch
@@ -0,0 +1,99 @@
+This is SVN revision 2171, whose log says:
+
+ Don't write to output beyond the current thread's range when initialising
+ sequences
+
+Index: pm1fs2.c
+===================================================================
+--- pm1fs2.c (revision 2170)
++++ pm1fs2.c (revision 2171)
+@@ -2093,10 +2093,13 @@
+ mpres_get_z (t, r[2], modulus);
+ outputf (OUTPUT_TRACE, "/* pm1_sequence_g */ g_%lu = %Zd; /* PARI */\n",
+ offset, t);
+- if (g_mpz != NULL)
+- mpz_set (g_mpz[offset], t);
+- if (g_ntt != NULL)
+- mpzspv_from_mpzv (g_ntt, offset, &t, 1UL, ntt_context);
++ if (l > 0)
++ {
++ if (g_mpz != NULL)
++ mpz_set (g_mpz[offset], t);
++ if (g_ntt != NULL)
++ mpzspv_from_mpzv (g_ntt, offset, &t, 1UL, ntt_context);
++ }
+
+ /* So here we have for i = 0
+ r[2] = x_0^(M-i) * r^{(M-i)^2}
+@@ -3513,20 +3516,23 @@
+ tmplen, tmp); /* v[0,1] = r^M * x_0 */
+ gfp_ext_pow_norm1_sl (r1_x[0], r1_y[0], v[0], v[1], M, Delta, modulus,
+ tmplen, tmp); /* r1[0] = (r^M * x_0)^M */
+- if (g_x != NULL)
+- mpres_get_z (g_x[offset], r1_x[0], modulus);
+- if (g_y != NULL)
+- mpres_get_z (g_y[offset], r1_y[0], modulus);
+- if (g_x_ntt != NULL)
++ if (l > 0)
+ {
+- mpres_get_z (mt, r1_x[0], modulus);
+- mpzspv_from_mpzv (g_x_ntt, offset, &mt, 1UL, ntt_context);
++ if (g_x != NULL)
++ mpres_get_z (g_x[offset], r1_x[0], modulus);
++ if (g_y != NULL)
++ mpres_get_z (g_y[offset], r1_y[0], modulus);
++ if (g_x_ntt != NULL)
++ {
++ mpres_get_z (mt, r1_x[0], modulus);
++ mpzspv_from_mpzv (g_x_ntt, offset, &mt, 1UL, ntt_context);
++ }
++ if (g_y_ntt != NULL)
++ {
++ mpres_get_z (mt, r1_y[0], modulus);
++ mpzspv_from_mpzv (g_y_ntt, offset, &mt, 1UL, ntt_context);
++ }
+ }
+- if (g_y_ntt != NULL)
+- {
+- mpres_get_z (mt, r1_y[0], modulus);
+- mpzspv_from_mpzv (g_y_ntt, offset, &mt, 1UL, ntt_context);
+- }
+
+
+ /* Compute g[1] = r1[1] = x0^(M-1) * r^((M-1)^2) = (x0 * r^(M-1))^(M-1).
+@@ -3537,20 +3543,23 @@
+ tmplen, tmp);
+ gfp_ext_pow_norm1_sl (r1_x[1], r1_y[1], v[0], v[1], M - 1, Delta,
+ modulus, tmplen, tmp);
+- if (g_x != NULL)
+- mpres_get_z (g_x[offset + 1], r1_x[1], modulus);
+- if (g_y != NULL)
+- mpres_get_z (g_y[offset + 1], r1_y[1], modulus);
+- if (g_x_ntt != NULL)
++ if (l > 1)
+ {
+- mpres_get_z (mt, r1_x[1], modulus);
+- mpzspv_from_mpzv (g_x_ntt, offset + 1, &mt, 1UL, ntt_context);
++ if (g_x != NULL)
++ mpres_get_z (g_x[offset + 1], r1_x[1], modulus);
++ if (g_y != NULL)
++ mpres_get_z (g_y[offset + 1], r1_y[1], modulus);
++ if (g_x_ntt != NULL)
++ {
++ mpres_get_z (mt, r1_x[1], modulus);
++ mpzspv_from_mpzv (g_x_ntt, offset + 1, &mt, 1UL, ntt_context);
++ }
++ if (g_y_ntt != NULL)
++ {
++ mpres_get_z (mt, r1_y[1], modulus);
++ mpzspv_from_mpzv (g_y_ntt, offset + 1, &mt, 1UL, ntt_context);
++ }
+ }
+- if (g_y_ntt != NULL)
+- {
+- mpres_get_z (mt, r1_y[1], modulus);
+- mpzspv_from_mpzv (g_y_ntt, offset + 1, &mt, 1UL, ntt_context);
+- }
+
+
+ /* x0 := $x_0 * r^{2M - 3}$ */
diff --git a/gmp-ecm.spec b/gmp-ecm.spec
index 2cc398b..77a9068 100644
--- a/gmp-ecm.spec
+++ b/gmp-ecm.spec
@@ -1,11 +1,15 @@
Name: gmp-ecm
-Version: 6.4.2
-Release: 2%{?dist}
+Version: 6.4.3
+Release: 1%{?dist}
Summary: Elliptic Curve Method for Integer Factorization
Group: Applications/Engineering
License: GPLv3+
URL: https://gforge.inria.fr/projects/ecm/
-Source0: https://gforge.inria.fr/frs/download.php/30448/ecm-%{version}.tar.gz
+Source0: https://gforge.inria.fr/frs/download.php/30965/ecm-%{version}.tar.gz
+# SVN revision 1971, which makes PPC64 assembly work with --enable-shared
+Patch0: %{name}-ppc64-func-descs.patch
+# SVN revision 2171, which fixes a bug with multithread support
+Patch1: %{name}-thread.patch
BuildRequires: docbook-style-xsl
BuildRequires: gmp-devel
@@ -55,6 +59,8 @@ The static libraries for using %{name} for development.
%prep
%setup -q -n ecm-%{version}
+%patch0
+%patch1
# Fix non-UTF-8 encodings
for badfile in ChangeLog README AUTHORS ; do
@@ -79,7 +85,7 @@ sed -i 's/func_apped/func_append/' ltmain.sh
FLGS="--enable-shared --enable-openmp --disable-gmp-cflags"
# Build an SSE2-enabled version for 32-bit x86
-%ifarch %ix86
+%ifarch %{ix86}
%configure ${FLGS} --build=pentium4-pc-linux-gnu --host=pentium4-pc-linux-gnu \
--disable-static --enable-sse2 \
CFLAGS="$RPM_OPT_FLAGS -std=gnu99 -march=pentium4 -Wa,--noexecstack" \
@@ -168,6 +174,10 @@ make check
%changelog
+* Fri Dec 7 2012 Jerry James <loganjerry at gmail.com> - 6.4.3-1
+- New upstream release
+- Fix PPC64 build (bz 804330)
+
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 6.4.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
diff --git a/sources b/sources
index b4e84dc..b98acb0 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-0785d0569f18f5362038e03f287d4dc9 ecm-6.4.2.tar.gz
+7c6bec30cfd2410bd794cfa55fb7d781 ecm-6.4.3.tar.gz
More information about the scm-commits
mailing list