diff mbox series

[bug#49880,2/2] gnu: gmp-boot: Fix t-scan test crash

Message ID 20210804184128.153984-1-bauermann@kolabnow.com
State Accepted
Headers show
Series [bug#49880,1/2] gnu: gmp-boot: Fix build on powerpc64le-linux | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Thiago Jung Bauermann Aug. 4, 2021, 6:41 p.m. UTC
GMP 4.3 was released with a bug in the t-scan test which causes it to crash
with a segmentation fault. Backport fix from upstream.

* gnu/packages/commencement.scm (gmp-boot): Apply
gmp-4.3-fix-t-scan-test.patch.
* gnu/packages/patches/gmp-4.3-fix-t-scan-test.patch: New file.
---

Hello,

With this and the previous patch applied, gmp-boot builds successfully
on powerpc64le-linux both in master and core-updates-frozen.

It should also fix the same problem in i686-linux:

https://ci.guix.gnu.org/build/699347/details

 gnu/packages/commencement.scm                 |  4 +++-
 .../patches/gmp-4.3-fix-t-scan-test.patch     | 24 +++++++++++++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/gmp-4.3-fix-t-scan-test.patch

Comments

Ludovic Courtès Aug. 11, 2021, 9:34 p.m. UTC | #1
Thiago Jung Bauermann <bauermann@kolabnow.com> skribis:

> GMP 4.3 was released with a bug in the t-scan test which causes it to crash
> with a segmentation fault. Backport fix from upstream.
>
> * gnu/packages/commencement.scm (gmp-boot): Apply
> gmp-4.3-fix-t-scan-test.patch.
> * gnu/packages/patches/gmp-4.3-fix-t-scan-test.patch: New file.

Please add the file to gnu/local.mk as well.

> +              ;; See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60933#c11
> +              (patches (search-patches "gmp-4.3-fix-t-scan-test.patch"))))

Comments about the patch should go at the top of the patch, preferably.

So, we could avoid a world rebuild by applying the patch in a
powerpc64le-specific build phase instead of adding it to ‘patches’.

Now, I suppose we’re just lucky that this test hasn’t crashed on other
platforms, aren’t we?  In that case, that would call for applying the
patch (or skipping tests, even) unconditionally, thus triggering a world
rebuild on all arches.

Thoughts?

Ludo’.
diff mbox series

Patch

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index ae3f07bc59ef..16eb46d44d77 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -1840,7 +1840,9 @@  ac_cv_c_float_format='IEEE (little-endian)'
               (uri (string-append "mirror://gnu/gmp/gmp-" version
                                   ".tar.gz"))
               (sha256 (base32
-                       "15rwq54fi3s11izas6g985y9jklm3xprfsmym3v1g6xr84bavqvv"))))
+                       "15rwq54fi3s11izas6g985y9jklm3xprfsmym3v1g6xr84bavqvv"))
+              ;; See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60933#c11
+              (patches (search-patches "gmp-4.3-fix-t-scan-test.patch"))))
     (arguments
      (substitute-keyword-arguments (package-arguments gmp)
        ((#:configure-flags gmp-configure-flags)
diff --git a/gnu/packages/patches/gmp-4.3-fix-t-scan-test.patch b/gnu/packages/patches/gmp-4.3-fix-t-scan-test.patch
new file mode 100644
index 000000000000..85b4b666215a
--- /dev/null
+++ b/gnu/packages/patches/gmp-4.3-fix-t-scan-test.patch
@@ -0,0 +1,24 @@ 
+Testcase fix obtained from upstream at:
+
+https://gmplib.org/repo/gmp/raw-rev/966737bd91ed
+
+# HG changeset patch
+# User Torbjorn Granlund <tege@gmplib.org>
+# Date 1318259187 -7200
+# Node ID 966737bd91ed4cd158ca9730167f70db47442fc1
+# Parent  27913f466a23776215bd9341866e10a50cf61c01
+(check_ref): Fix loop end bound.
+
+diff -r 27913f466a23 -r 966737bd91ed tests/mpz/t-scan.c
+--- a/tests/mpz/t-scan.c	Mon Oct 10 12:06:39 2011 +0200
++++ b/tests/mpz/t-scan.c	Mon Oct 10 17:06:27 2011 +0200
+@@ -79,7 +79,7 @@
+ 
+               for (isize = 0; isize <= size; isize++)
+                 {
+-                  for (oindex = 0; oindex <= numberof (offset); oindex++)
++                  for (oindex = 0; oindex < numberof (offset); oindex++)
+                     {
+                       o = offset[oindex];
+                       if ((int) isize*GMP_NUMB_BITS < -o)
+