Subject: Re: pkg/30414 [ Re: [Rui Paulo] problem when linked to libpthread]
To: None <>
From: Rui Paulo <>
List: tech-pkg
Date: 09/29/2005 18:56:36
[Forwarded with explicit permission]

----- Forwarded message from Marcus Brinkmann <> -----

From: Marcus Brinkmann <>
To: Rui Paulo <>
Subject: Re: [Rui Paulo] problem when linked to libpthread
Date: Thu, 29 Sep 2005 02:51:57 +0200
User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.7
 (Sanj?) APEL/10.6 Emacs/21.4 (i386-pc-linux-gnu)
Message-ID: <>


At Mon, 4 Jul 2005 15:09:54 +0100,
Rui Paulo <> wrote:
> While investigating a supposed pthread problem under NetBSD with the
> help of Nathan Williams, he noticed that our pkg infrastructure, pkgsrc,
> is linking with, event that should only
> happen with
> This causes the problem described under PR#30414 [1].
> I'm new to gpgme code, but seems like if isn't linked with
> pthread (which should be the correct way), ath_* calls get translated to
> no-ops or to their libc counterpart (recvmsg, sendmsg, etc).
> While there is a problem with pkgsrc, I would like to know your opinion
> about this problem, as it may happen under other systems or package
> infrastructures.

This part of the code was always a bit on the dark and ugly side.  In
the CVS version of GPGME (HEAD branch), this code is now removed, and
only libgpgme-pthread is linked against pthread.  Also, the Pth CFLAGS
are only added when compiling the pth related files, so the pth
pthread.h header doesn't get mixed up with the system header
accidentially.  See the below NEWS and ChangeLog entry.

This fix will be part of the upcoming GPGME 1.1.x branch release.

If you test the CVS HEAD version, I would appreciate your feedback how
it worked for you.


 * The code for "automagically detecting the thread library" has been
   removed from libgpgme.  It is deprecated since version 0.4.3.
   Since then, you had to link against libgpgme-pthread for
   applications using pthread and libgpgme-pth for applications using
   GNU Pth.

   The code was removed because it caused compilation problems on
   systems where the pthread.h header from GNU Pth is available in
   addition to the system header (FreeBSD 6 and later for example).

2005-09-12  Marcus Brinkmann  <>

        * (libgpgme_la_SOURCES): Set to ath.h and ath.c.
        (ath_pth_src, ath_pthread_src): Removed.
        (w32_o_files): Replace ath-compat.o with ath.o.
        (libgpgme_pth_la_CFLAGS): New variable.
        * ath-compat.c, ath-pthread-compat.c, ath-pth-compat.c: Removed.
        * ath.h (ath_pthread_available, ath_pth_available): Removed.
        (ath_init) [!_ATH_EXT_SYM_PREFIX]: Do not define macro.
        (struct ath_ops, ath_init) [_ATH_COMPAT]: Removed.
        (_ATH_COMPAT): Macro removed.
        * posix-sema.c (_gpgme_sema_subsystem_init): Do not call

----- End forwarded message -----

		-- Rui Paulo