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


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;


Related Objects

ffontaine updated the task description. (Show Details)
werner triaged this task as Normal priority.
gniibe claimed this task.Aug 13 2019, 7:13 AM
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/
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.

gniibe closed this task as Resolved.Dec 6 2019, 3:07 AM