gpgme: [PATCH] tests: Fix pthread linking error.

NIIBE Yutaka gniibe at
Thu Nov 11 02:26:54 CET 2021

Ben Kibbey <bjk at> wrote:
> Fixes linking issue for Android on arm64 and possibly others.

Thank you for the report.

I think that this is an issue of libc/libpthread usage.

In fact, newer GNU C library has similar issue, as pthreads
implementation is now integraged into libc (no need for -lpthread).

In GnuPG libraries, we handled this issue in libgpg-error.

Because GPGME uses libgpg-error, I change tests/ to fix.

Please test if it works for your case.


diff --git a/tests/ b/tests/
index 8950e965..e4346576 100644
--- a/tests/
+++ b/tests/
@@ -37,8 +37,9 @@ noinst_PROGRAMS = $(TESTS) run-keylist run-export run-import run-sign \
 		  run-verify run-encrypt run-identify run-decrypt run-genkey \
 		  run-keysign run-tofu run-swdb run-threaded
-run_threaded_LDADD = ../src/ -lpthread @GPG_ERROR_LIBS@ \
+run_threaded_CPPFLAGS = -I$(top_builddir)/src @GPG_ERROR_MT_CFLAGS@
+run_threaded_LDADD = ../src/ \
 gpgtests = gpg json

More information about the Gnupg-devel mailing list