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

Ben Kibbey bjk at luxsci.net
Thu Nov 11 04:31:53 CET 2021


On Thu, Nov 11, 2021 at 10:26:54AM +0900, NIIBE Yutaka wrote:
> 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.

That's good to know.

> Because GPGME uses libgpg-error, I change tests/Makefile.am to fix.
> 
> Please test if it works for your case.

Thanks. The build is good now except the forgotten tests/gpg tests:

diff --git a/tests/gpg/Makefile.am b/tests/gpg/Makefile.am
index bab9dd9a..00613b48 100644
--- a/tests/gpg/Makefile.am
+++ b/tests/gpg/Makefile.am
@@ -68,10 +68,18 @@ BUILT_SOURCES = gpg.conf gpg-agent.conf pubring-stamp \
 AM_CPPFLAGS = -I$(top_builddir)/src @GPG_ERROR_CFLAGS@
 AM_LDFLAGS = -no-install
 LDADD = ../../src/libgpgme.la @LDADD_FOR_TESTS_KLUDGE@
-t_thread1_LDADD = ../../src/libgpgme.la -lpthread @LDADD_FOR_TESTS_KLUDGE@
-t_thread_keylist_LDADD = ../../src/libgpgme.la -lpthread @LDADD_FOR_TESTS_KLUDGE@
-t_thread_keylist_verify_LDADD = ../../src/libgpgme.la -lpthread @LDADD_FOR_TESTS_KLUDGE@
-t_cancel_LDADD = ../../src/libgpgme.la -lpthread @LDADD_FOR_TESTS_KLUDGE@
+t_thread1_CPPFLAGS = @GPG_ERROR_MT_CFLAGS@
+t_thread1_LDADD = ../../src/libgpgme.la @GPG_ERROR_MT_LIBS@ \
+		  @LDADD_FOR_TESTS_KLUDGE@
+t_thread_keylist_CPPFLAGS = @GPG_ERROR_MT_CFLAGS@
+t_thread_keylist_LDADD = ../../src/libgpgme.la @GPG_ERROR_MT_LIBS@ \
+			 @LDADD_FOR_TESTS_KLUDGE@
+t_thread_keylist_verify_CPPFLAGS = @GPG_ERROR_MT_CFLAGS@
+t_thread_keylist_verify_LDADD = ../../src/libgpgme.la @GPG_ERROR_MT_LIBS@ \
+				@LDADD_FOR_TESTS_KLUDGE@
+t_cancel_CPPFLAGS = @GPG_ERROR_MT_CFLAGS@
+t_cancel_LDADD = ../../src/libgpgme.la @GPG_ERROR_MT_LIBS@ \
+		 @LDADD_FOR_TESTS_KLUDGE@
 
 # We don't run t-genkey and t-cancel in the test suite, because it
 # takes too long

-- 
Ben Kibbey
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.gnupg.org/pipermail/gnupg-devel/attachments/20211110/4a6f74e6/attachment.sig>


More information about the Gnupg-devel mailing list