summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2014-08-04 10:45:49 +0200
committerMax Krummenacher <max.krummenacher@toradex.com>2014-08-04 11:12:28 +0200
commit2987c851e107648b3ce28cdad5447c2f0cb6be02 (patch)
tree850c2a64b8467e867fdff3216fbc50d83decf1f7
parent7b25f64d9e947820999477068cb185fd585bc19b (diff)
gnutls: hack to use libpthread
gnutls use libgcrypt and should init gcrypt's mutex functionality but does not. This leads to asserts in libgcrypt: Ohhhh jeeee: Assertion `pool_is_locked' failed (random-csprng.c:615:mix_pool) This patch hacks autoconf to always use libpthread and thus initalizes libgcrypt with working mutex functions.
-rw-r--r--recipes-support/gnutls/files/libpthreadhack.patch34
-rw-r--r--recipes-support/gnutls/gnutls_%.bbappend3
2 files changed, 37 insertions, 0 deletions
diff --git a/recipes-support/gnutls/files/libpthreadhack.patch b/recipes-support/gnutls/files/libpthreadhack.patch
new file mode 100644
index 0000000..0086a3a
--- /dev/null
+++ b/recipes-support/gnutls/files/libpthreadhack.patch
@@ -0,0 +1,34 @@
+diff -Naur gnutls-2.12.23.orig/lib/configure.ac gnutls-2.12.23/lib/configure.ac
+--- gnutls-2.12.23.orig/lib/configure.ac 2014-08-01 19:01:35.243966651 +0200
++++ gnutls-2.12.23/lib/configure.ac 2014-08-01 19:01:49.398773492 +0200
+@@ -124,7 +124,18 @@
+ lgl_INIT
+
+ AC_CHECK_FUNCS(getrusage,,)
+-AC_LIB_HAVE_LINKFLAGS(pthread,, [#include <pthread.h>], [pthread_mutex_lock (0);])
++
++#hack: the cross compile here thinks libpthread is not available.
++#AC_LIB_HAVE_LINKFLAGS(pthread,, [#include <pthread.h>], [pthread_mutex_lock (0);])
++HAVE_LIBPTHREAD=yes
++LIBPTHREAD=-lpthread
++LTLIBPTHREAD=-lpthread
++LIBPTHREAD_PREFIX=/mnt/sdc2/oe-disk/oe-core_V2.3/build/out-eglibc/sysroots/colibri-t30/usr
++AC_DEFINE([HAVE_LIBPTHREAD], 1, [Define if you have the $1 library.])
++AC_SUBST([HAVE_LIBPTHREAD])
++AC_SUBST([LIBPTHREAD])
++AC_SUBST([LTLIBPTHREAD])
++AC_SUBST([LIBPTHREAD_PREFIX])
+
+ LIBGNUTLS_LIBS="-lgnutls $LIBS"
+ LIBGNUTLS_CFLAGS=""
+diff -Naur gnutls-2.12.23.orig/lib/gnutls_int.h gnutls-2.12.23/lib/gnutls_int.h
+--- gnutls-2.12.23.orig/lib/gnutls_int.h 2012-11-08 17:11:15.000000000 +0100
++++ gnutls-2.12.23/lib/gnutls_int.h 2014-08-01 20:58:48.406146057 +0200
+@@ -28,6 +28,7 @@
+
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
++#include "config.h"
+ #endif
+
+ #include <stddef.h>
diff --git a/recipes-support/gnutls/gnutls_%.bbappend b/recipes-support/gnutls/gnutls_%.bbappend
new file mode 100644
index 0000000..4924aa3
--- /dev/null
+++ b/recipes-support/gnutls/gnutls_%.bbappend
@@ -0,0 +1,3 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+SRC_URI += "file://libpthreadhack.patch"