Page MenuHome GnuPG

compilation error libgcrypt 1.10.1
Open, NormalPublic

Description

Hello,
I am trying to compile the latest release of libgcrypt for my gnupg paket.
Platform AIX 7.2, POWER, compiler IBM xlC 16.1.0.7
Using the last working compile statement, I receive the following error message:

libtool: compile:  cc -qlanglvl=extc89 -DHAVE_CONFIG_H -I. -I.. -I../src -I../src -I../mpi -I../mpi -I/opt/freeware/include -qmaxmem=16384 -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_AIX52 -D_AIX53 -D_AIX61 -D_AIX71 -D_AIX72 -D_ALL_SOURCE -DFUNCPROTO=15 -O2 -I/opt/freeware/include -c kdf.c -Wp,-qmakedep=gcc,-MF.deps/kdf.TPlo  -DPIC -o .libs/kdf.o
"kdf.c", line 955.1: 1506-343 (S) Redeclaration of _gcry_kdf_compute differs from previous declaration on line 217 of "../src/gcrypt-int.h".
"kdf.c", line 955.1: 1506-050 (I) Return type "enum {...}" in redeclaration is not compatible with the previous return type "unsigned int".

Any ideas how to resolve this?
Or can/should I stick with the LTS version of libgcrypt? (currently I am using 1.9.4)

Using the newer xlclang++ compiler throws a different failure:

libtool: compile:  xlclang++ -DHAVE_CONFIG_H -I. -I.. -I../src -I../src -I/opt/freeware/include -qmaxmem=16384 -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_AIX52 -D_AIX53 -D_AIX61 -D_AIX71 -D_AIX72 -D_ALL_SOURCE -DFUNCPROTO=15 -O2 -I/opt/freeware/include -fno-delete-null-pointer-checks -Wall -MT mpi-bit.lo -MD -MP -MF .deps/mpi-bit.Tpo -c mpi-bit.c  -DPIC -o .libs/mpi-bit.o
warning: 1540-5200 The option "-fno-delete-null-pointer-checks" is not supported.
1 warning generated.
Assembler:
.libs/mpi-bit$1.s: line 48: Error In Syntax
1500-067: (S) asm statement generates errors in assembler output.

Thank you in advance an kind regards
Frank

Details

Version
1.10.1

Related Objects

Event Timeline

gniibe triaged this task as Normal priority.May 17 2022, 4:31 AM
gniibe added projects: backport, Testing.
gniibe added a subscriber: gniibe.

Thank you for the bug report.

For the first one, indeed, it's a bug in libgcrypt.

diff --git a/src/gcrypt-int.h b/src/gcrypt-int.h
index 08977d32..04953ffc 100644
--- a/src/gcrypt-int.h
+++ b/src/gcrypt-int.h
@@ -214,8 +214,8 @@ gpg_err_code_t _gcry_kdf_open (gcry_kdf_hd_t *hd, int algo, int subalgo,
                                const void *salt, size_t saltlen,
                                const void *key, size_t keylen,
                                const void *ad, size_t adlen);
-gcry_error_t _gcry_kdf_compute (gcry_kdf_hd_t h,
-                                const struct gcry_kdf_thread_ops *ops);
+gcry_err_code_t _gcry_kdf_compute (gcry_kdf_hd_t h,
+                                   const struct gcry_kdf_thread_ops *ops);
 gpg_err_code_t _gcry_kdf_final (gcry_kdf_hd_t h, size_t resultlen, void *result);
 void _gcry_kdf_close (gcry_kdf_hd_t h);

Fixed in master and 1.10 branch.

For the second, I wonder if newer xlclang++ compiler works with 1.9.

IIUC, it fails at libgcrypt/mpi/longlong.h, which does:

# define count_leading_zeros(count, x) \
  __asm__ ("{cntlz|cntlzw} %0,%1"                                       \
	   : "=r" ((count))                                             \
	   : "r" ((USItype)(x)))

It has two syntax-es for the instrution: one for PowerPC, another is for POWER. cntlz and cntlzw. Perhaps, this syntax is not supported by newer assembler. I suspected because in GCC, the longlong.h has been changed to only for POWER (cntlzw), ten years ago.

I do not claim I understand anything of this assembler syntax :)

For the second, I wonder if newer xlclang++ compiler works with 1.9.

I doubt it, up till now I used cc for libgcrypt and libgpg-error, because both failed with xlclang++.
The other parts gnupg, libassuan, libksba, pinentry and npth work find with xlclang++.
If you need any help in making those last two libraries work, I can try to assist.