Page MenuHome GnuPG

libgcrypt build-error with gcc-15 on powerpc and alpha
Open, Needs TriagePublic

Description

On some archs libgcrypt fails to build from source with gcc-15. Helmut Grohne writes:

libgcrypt20 fails to build from source with gcc-15 for some
architectures. The cause may be found in mpi/longlong.h. In several
lines such as 193, 499 and 1409, there are function prototypes without
arguments. This trips up the updated language standard by gcc-15 and
building libcrypt20 now complains about excess arguments. For example:

In file included from ../../mpi/mpih-div.c:32:
../../mpi/mpih-div.c: In function ‘_gcry_mpih_mod_1’:
../../mpi/longlong.h:190:11: error: too many arguments to function ‘__udiv_qrnnd’; expected 0, have 4
  190 |     (q) = __udiv_qrnnd (&__r, (n1), (n0), (d));                         \
      |           ^~~~~~~~~~~~  ~~~~
../../mpi/mpih-div.c:84:17: note: in expansion of macro ‘udiv_qrnnd’
   84 |                 udiv_qrnnd(divisor_limb_inverted, dummy,
      |                 ^~~~~~~~~~
../../mpi/longlong.h:193:16: note: declared here

This does not seem to affect amd64 as Matthias would have otherwise
reported this problem already. It does affect at least alpha.

I do not see this on arm64, powerpc64le shows a different issue:

libtool: link: ( cd ".libs" && rm -f "libgcrypt.la" && ln -s "../libgcrypt.la" "libgcrypt.la" )
/bin/bash ../libtool  --tag=CC   --mode=link gcc-15  -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/home/ametzler/GCR/libgcrypt20-1.11.1=. -fstack-protector-strong -Wformat -Werror=format-security -fvisibility=hidden -fno-delete-null-pointer-checks -Wall  -Wl,-z,relro -Wl,-z,now -o mpicalc mpicalc-mpicalc.o libgcrypt.la -L/usr/lib/powerpc64le-linux-gnu -lgpg-error
libtool: link: gcc-15 -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/home/ametzler/GCR/libgcrypt20-1.11.1=. -fstack-protector-strong -Wformat -Werror=format-security -fvisibility=hidden -fno-delete-null-pointer-checks -Wall -Wl,-z -Wl,relro -Wl,-z -Wl,now -o .libs/mpicalc mpicalc-mpicalc.o  ./.libs/libgcrypt.so -L/usr/lib/powerpc64le-linux-gnu -lgpg-error
/usr/bin/ld: ./.libs/libgcrypt.so: undefined reference to `gcry_poly1305_p10le_4blocks'
/usr/bin/ld: ./.libs/libgcrypt.so: undefined reference to `_gcry_chacha20_p10le_8x'
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:662: mpicalc] Error 1
make[3]: Leaving directory '/home/ametzler/GCR/libgcrypt20-1.11.1/build/src'

Comparing the buildlogs for gcc14 and 15 on this arch shows no errors/warnings, I was surprised that support for "checking whether GCC inline assembler supports PowerISA 3.00 instructions." stopped succeeding with gcc-15.

Details

External Link
https://bugs.debian.org/1109071
Version
1.11.0

Related Objects

Event Timeline

Sure that this is about 1.11.0 ? We released 1.11.1 with at least one fix for gcc regression (T7166). In master we had some more fixes for gcc 15 bugs (or what ever you will call such regression in a compiler)

Sure that this is about 1.11.0 ? We released 1.11.1 with at least one fix for gcc regression (T7166). In master we had some more fixes for gcc 15 bugs (or what ever you will call such regression in a compiler)

Helmut tested on 1.11.0, the powerpc64le issue was reproduced by me on 1.11.1.
I have asked Helmut on which archs except alpha (I have no access there) I should be able to reproduce the original issue.

werner renamed this task from libgcrypt build-error with gcc-15 to libgcrypt build-error with gcc-15 on powerpc and alpha.Mon, Jul 14, 4:54 PM