diff mbox

[09/18] libxml2: (Better) Windows support

Message ID 1407352684-7837-9-git-send-email-diorcet.yann@gmail.com
State Under Review
Delegated to: Kim
Headers show

Commit Message

Yann Diorcet Aug. 6, 2014, 7:17 p.m. UTC
---
 .../libxml/libxml2-2.9.0/pthread_once_init_fix.patch | 20 ++++++++++++++++++++
 recipes/libxml/libxml2.inc                           |  2 +-
 2 files changed, 21 insertions(+), 1 deletion(-)
 create mode 100644 recipes/libxml/libxml2-2.9.0/pthread_once_init_fix.patch
diff mbox

Patch

diff --git a/recipes/libxml/libxml2-2.9.0/pthread_once_init_fix.patch b/recipes/libxml/libxml2-2.9.0/pthread_once_init_fix.patch
new file mode 100644
index 0000000..847aa39
--- /dev/null
+++ b/recipes/libxml/libxml2-2.9.0/pthread_once_init_fix.patch
@@ -0,0 +1,20 @@ 
+diff -urN libxml2-2.9.0/threads.c libxml2-2.9.0.mod/threads.c
+--- libxml2-2.9.0/threads.c	2012-09-11 05:52:46.000000000 +0200
++++ libxml2-2.9.0.mod/threads.c	2012-10-17 18:00:08.000000000 +0200
+@@ -146,6 +146,7 @@
+ static pthread_key_t globalkey;
+ static pthread_t mainthread;
+ static pthread_once_t once_control = PTHREAD_ONCE_INIT;
++static pthread_once_t once_control_init = PTHREAD_ONCE_INIT;
+ static pthread_mutex_t global_init_lock = PTHREAD_MUTEX_INITIALIZER;
+ #elif defined HAVE_WIN32_THREADS
+ #if defined(HAVE_COMPILER_TLS)
+@@ -915,7 +916,7 @@
+ #ifdef HAVE_PTHREAD_H
+     if ((libxml_is_threaded)  && (pthread_key_delete != NULL))
+         pthread_key_delete(globalkey);
+-    once_control = PTHREAD_ONCE_INIT;
++    once_control = once_control_init;
+ #elif defined(HAVE_WIN32_THREADS) && !defined(HAVE_COMPILER_TLS) && (!defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL))
+     if (globalkey != TLS_OUT_OF_INDEXES) {
+         xmlGlobalStateCleanupHelperParams *p;
diff --git a/recipes/libxml/libxml2.inc b/recipes/libxml/libxml2.inc
index 7c62d07..37374c6 100644
--- a/recipes/libxml/libxml2.inc
+++ b/recipes/libxml/libxml2.inc
@@ -19,7 +19,7 @@  EXTRA_OECONF = "\
  --with-c14n"
 
 LDFLAGS_LDL = "-ldl"
-LDFLAGS_LDL:TARGET_OS_mingw32 = ""
+LDFLAGS_LDL:TARGET_LIBC_mingw = ""
 export LDFLAGS += "${LDFLAGS_LDL}"
 
 PACKAGES =+ "${PN}-utils"