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

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


Ben Kibbey <bjk at luxsci.net> 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/Makefile.am to fix.

Please test if it works for your case.

-- 

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 8950e965..e4346576 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -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/libgpgme.la -lpthread @GPG_ERROR_LIBS@ \
-		     @LDADD_FOR_TESTS_KLUDGE@
+run_threaded_CPPFLAGS = -I$(top_builddir)/src @GPG_ERROR_MT_CFLAGS@
+run_threaded_LDADD = ../src/libgpgme.la \
+		     @GPG_ERROR_MT_LIBS@ @LDADD_FOR_TESTS_KLUDGE@
 
 if RUN_GPG_TESTS
 gpgtests = gpg json



More information about the Gnupg-devel mailing list