[vlc-commits] contrib: upnp: fix pthread linking (fixes #16390)

Rémi Denis-Courmont git at videolan.org
Sat Aug 6 10:58:49 CEST 2016


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Aug  6 11:58:28 2016 +0300| [33da3d81805f01572f500e36febe0dde34db407c] | committer: Rémi Denis-Courmont

contrib: upnp: fix pthread linking (fixes #16390)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=33da3d81805f01572f500e36febe0dde34db407c
---

 contrib/src/upnp/libpthread.patch | 15 +++++++++++++++
 contrib/src/upnp/rules.mak        |  1 +
 2 files changed, 16 insertions(+)

diff --git a/contrib/src/upnp/libpthread.patch b/contrib/src/upnp/libpthread.patch
new file mode 100644
index 0000000..e306759
--- /dev/null
+++ b/contrib/src/upnp/libpthread.patch
@@ -0,0 +1,15 @@
+On GNU/Linux, -pthread does not work properly when linking a static
+library that depends on POSIX threads. -lpthread must be checked first.
+
+diff -Nru upnp.orig/m4/acx_pthread.m4 upnp/m4/acx_pthread.m4
+--- upnp.orig/m4/acx_pthread.m4	2016-08-06 11:54:20.990800226 +0300
++++ upnp/m4/acx_pthread.m4	2016-08-06 11:54:37.909800395 +0300
+@@ -123,7 +123,7 @@
+ # which indicates that we try without any flags at all, and "pthread-config"
+ # which is a program returning the flags for the Pth emulation library.
+ 
+-acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
++acx_pthread_flags="pthreads none -Kthread -kthread lthread -lpthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
+ 
+ # The ordering *is* (sometimes) important.  Some notes on the
+ # individual items follow:
diff --git a/contrib/src/upnp/rules.mak b/contrib/src/upnp/rules.mak
index eddc291..d8f6609 100644
--- a/contrib/src/upnp/rules.mak
+++ b/contrib/src/upnp/rules.mak
@@ -37,6 +37,7 @@ ifdef HAVE_WINSTORE
 	$(APPLY) $(SRC)/upnp/winrt-inet.patch
 endif
 endif
+	$(APPLY) $(SRC)/upnp/libpthread.patch
 	$(APPLY) $(SRC)/upnp/libupnp-ipv6.patch
 	$(APPLY) $(SRC)/upnp/miniserver.patch
 	$(APPLY) $(SRC)/upnp/missing_win32.patch



More information about the vlc-commits mailing list