Bug in GMP 6.1.0 + ARM

Karine Even-Mendoza karine.even_mendoza at kcl.ac.uk
Fri Oct 4 12:49:06 CEST 2024


Hi,

I tried building GMP 6.1.0 on ARMv8 machine (aarch64):
wget ftp://gcc.gnu.org/pub/gcc/infrastructure/gmp-6.1.0.tar.bz2
bunzip2 gmp-6.1.0.tar.bz2
tar xvf gmp-6.1.0.tar
cd gmp-6.1.0
./configure --disable-shared --enable-static --prefix=/tmp/gcc
make && make check && make install

GCC:
With gcc 11.4.0 and -O2 one of the tests fails:

../test-driver: line 107: 118960 Aborted                 (core dumped) "$@" > $log_file 2>&1

FAIL: t-count_zeros
And with a bit of investigation:
Program received signal SIGABRT, Aborted. __pthread_kill_implementation (threadid=281474842459776, signo=signo at entry=6, no_tid=no_tid at entry=0) at ./nptl/pthread_kill.c:44 44 ./nptl/pthread_kill.c: No such file or directory. (gdb)

When building with:

gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

Next, I tried with gcc -O0, and then the make check ends normally.

I repeated it with GMP 6.3.0 (got with ).


CLANG:
To rule out, issues form gcc, I tried clang too. I build GMP 6.1.0 with clang 14 and -O2 and then one of the tests failed:

../../test-driver: line 107: 141274 Aborted                 (core dumped) "$@" > $log_file 2>&1

FAIL: t-sqrlo
With this version:

Ubuntu clang version 14.0.0-1ubuntu1.1

Target: aarch64-unknown-linux-gnu

Thread model: posix

InstalledDir: /usr/bin
the log shows:
===
cat tests/mpn/test-suite.log
============================================
   GNU MP 6.1.0: tests/mpn/test-suite.log
============================================

# TOTAL: 46
# PASS:  45
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: t-sqrlo
=============

ERROR in test 0, n = 12before scratch:0
keep:   FFFF00000000
after scratch:0
keep:   FFFF9E678708
1FFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000003FFFFC0000000000000000000000000000F00000000000003FFFFFC00000000000000000000000000000000003FFFFFF800000000000000000000000
1F7FFDE0100200000000E100000000000077FFFF89FFFFDFD00003E0000010000000000000077FFFFF10000001FFFFFDC0000040000000000000000000000000000FFFFFFC000000400000000000000000000000000000000000000000000000
1F7FFDE0100200000000E100000000000077FFFF89FFFFDFD00003E0000010000000000000077FFFFF10000001FFFFFDC0000040000000000000000000000000000FFFFFFC000000400000000000000000000000000000000000000000000000
FAIL t-sqrlo (exit status: 134)
===

Then I tried to build GMP 6.3.0 with clang, and it normally ends (compilation and check) but skips one test:
SKIP: t-addaddmul

I think, as it is not the latest version, maybe it is not super interesting to fix this issue in older version of GMP, but maybe it is worth adding it as known issue in ARMv8, with the solution that is, to build it with -O0 or get newer version if possible.

Best,
Karine


More information about the gmp-bugs mailing list