tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

libgcrypt and pthread in bl3

I am working on an update to opensc to 0.13, based on work in wip by
Richard Hansen.   This is complicated by

  * the fact that upstream seems to think pthreads are non-optional for
    opensc, even though really there's nothing in the code that really
    requires that

  * The consequence of the notion that on NetBSD, non-threaded programs
    may not dlopen libraries linked with pthreads, that pam modules
    must therefore be non-threaded, and therefore that all libraries, to
    include smartcard libraries, must be non-threaded

So, in trying to get opensc built without -lpthread, I found that the
bl3 of libxslt via the included bl3 of libgcrypt includes
mk/  While I realize it's possible to make the
opensc package ignore the helpfully-set PTHREAD variables, I questioned
the correctness of this situation.  libgcrypt has several binaries and
one library, and on NetBSD 6 i386 none of them are linked with
-lpthread.  I also don't get threads linked on OSX 10.9 (abi=32, clang).
However, a test program inside the package does get linked with threads
(when one runs " make test").

So I don't see why a program that links against libgcrypt should be
suggested to use threads.  The inclusion of pthread in the bl3 was a
long time ago:

  revision 1.8
  date: 2004-11-14 10:38:42 -0500;  author: ben;  state: Exp;  lines: +2 -1;
  As it was, libtool failed to link to libgcrypt on NetBSD 1.6.x because
  buildlink did not bring in PTH.  For example, this made opencdk fail to
  build.  Fix this by adding mk/ to

and perhaps libgcrypt was linked threaded then; we've certainly had a
pthread-purging rampage going for a few years.  So I propose to apply
the following (pre-freeze, ideally) - comments/objections??

Index: security/libgcrypt/
RCS file: /cvsroot/pkgsrc/security/libgcrypt/,v
retrieving revision 1.16
diff -u -p -r1.16
--- security/libgcrypt/    1 Jan 2014 11:49:59 -0000       1.16
+++ security/libgcrypt/    13 Mar 2014 23:58:23 -0000
@@ -10,7 +10,9 @@ BUILDLINK_ABI_DEPENDS.libgcrypt+=     libgcr
 BUILDLINK_PKGSRCDIR.libgcrypt?=        ../../security/libgcrypt
 .include "../../security/libgpg-error/"
-.include "../../mk/"
+# In 2004, this was needed for pth on 1.6.  But libgcrypt is linked
+# without threads, so omit it.
+#.include "../../mk/"
 BUILDLINK_TREE+=       -libgcrypt

Attachment: pgp67Pb8Xxj3q.pgp
Description: PGP signature

Home | Main Index | Thread Index | Old Index