Subject: Re: pkg/30414 [marcus.brinkmann@ruhr-uni-bochum.de: Re: [Rui Paulo] libgpgme.so problem when linked to libpthread]
To: None <tech-pkg@NetBSD.org>
From: Rui Paulo <rpaulo@fnop.net>
List: tech-pkg
Date: 09/29/2005 18:56:36
[Forwarded with explicit permission]

----- Forwarded message from Marcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de> -----

From: Marcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de>
To: Rui Paulo <rpaulo@NetBSD.org>
Subject: Re: [Rui Paulo] libgpgme.so 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)
 MULE/5.0 (SAKAKI)
Message-ID: <87vf0kvgpe.wl%marcus.brinkmann@ruhr-uni-bochum.de>

Hi,

At Mon, 4 Jul 2005 15:09:54 +0100,
Rui Paulo <rpaulo@NetBSD.org> wrote:
> While investigating a supposed pthread problem under NetBSD with the
> help of Nathan Williams, he noticed that our pkg infrastructure, pkgsrc,
> is linking libgpgme.so with libpthread.so, event that should only
> happen with libgpgme-pthread.so.
> 
> This causes the problem described under PR#30414 [1].
> 
> I'm new to gpgme code, but seems like if libgpgme.so 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.

Thanks,
Marcus

 * 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).

gpgme/
2005-09-12  Marcus Brinkmann  <marcus@g10code.de>

        * Makefile.am (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
        _gpgme_ath_init.




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

		-- Rui Paulo