Still problems with GPGME with multithread

Marcus Brinkmann Marcus.Brinkmann at ruhr-uni-bochum.de
Wed Apr 2 21:07:02 CEST 2003


On Wed, Apr 02, 2003 at 07:34:32PM +0200, Albrecht Dreß wrote:
> Am 02.04.03 15:31 schrieb(en) Marcus Brinkmann:
> >I am not sure how you use libtool, but it seems you are using -lgpgme.la.
> 
> Nope. I build the list of libs (which is then fed into libtool) using the 
> command
> 
> BALSA_LIBS="$BALSA_LIBS `gpgme-config --libs`"

So libtool is reordering libs it doesn't know anything about?  How evil.
 
> >For a workaround, try without that and link to -lgpgme direcly, or even
> >"-lpthread -lgpgme", so it doesn't consider the la script and maybe that
> >helps to avoid the reordering.  As gpgme itself does not depend on other
> 
> Nope again. I tried the replace the command above with exactly this. 
> libtool gets the right sorting but still decides that libpthread must come 
> much later than libgpgme.

You could try to frob it that -lpthread -lgpgme ends up in the libtool
command _quoted_:  "-lpthread -lgpgme".  Not sure how to get the quotes
intact through all the layers of autoconf and automake, though.

> >I will consider the alternatives (fixing libtool or gpgme).
> 
> Either it's possible to *force* libtool linking a specific library before 
> an other one, or gpgme is simply not compatible with libtool (and, in 
> turn, with any software using it). Or say that libtool is crap...

I vowed an oath to protect libtool against disapproval :)

You can of course force libtool to link with pthread before gpgme.  But I
don't think you can do that optionally (ie, only if pthread is added to the
command line).  I am not sure, though.  YOu might try with

# Libraries that this one depends upon.
dependency_libs=''

in libgpgme.la, if it even looks at that file in your configuration.

I guess I have to investigate this more.

> IMHO, it's always nice to have some means for debugging...

There are plenty of means to debug such situations I can think of,
and none involves adding interfaces to gpgme :)  If you need help, I sugges
LD_DEBUG=help, gdb, and even ltrace.

> >I don't really want to link at run time, there is no need for that here.
> 
> ... as long as you don't use libtool ;-))

I realize there is a problem.  I will find a fix one way or another. :)

Thanks,
Marcus

-- 
`Rhubarb is no Egyptian god.' GNU      http://www.gnu.org    marcus at gnu.org
Marcus Brinkmann              The Hurd http://www.gnu.org/software/hurd/
Marcus.Brinkmann at ruhr-uni-bochum.de
http://www.marcus-brinkmann.de/




More information about the Gnupg-devel mailing list