Page MenuHome GnuPG

libgcrypt: fix build without threads by adding an option to disable tests
Closed, ResolvedPublic

Description

The patch attached adds an option to allow the user to disable tests.
This can be useful for example when the toolchain does not provide thread.
Indeed, in this case, libgcrypt fails to build t-lock:

t-lock.c: In function 'run_test':
t-lock.c:359:3: error: unknown type name 'pthread_t'
   pthread_t rthread;

Fixes:

Details

Version
1.8.4

Revisions and Commits

Event Timeline

werner triaged this task as Normal priority.Aug 2 2019, 11:33 AM
werner added a project: libgcrypt.
gniibe added a subscriber: gniibe.

Thanks for your report.
I think that adding an option for disabling tests is too much.
If it were AC_SUBST, we could use HAVE_PTHREAD in tests/Makefile.am.
In the current situation, just modifining t-lock is easier.

Fixing t-lock is indeed a better solution however having an option to disable tests could be used in another context than fixing this issue.
For example, in the context of buildroot (which goal is to build a custom embedded linux system), this option could be used to save time during compilation as well as to save space on the embedded system.