[libmemcached] Fix linking against libpthread

Remi Collet remi at fedoraproject.org
Sat Dec 14 06:30:41 UTC 2013


commit ca008a525dd788b1cf424c2658a636cea235e574
Author: Ruben Kerkhof <ruben at rubenkerkhof.com>
Date:   Tue Dec 3 16:56:42 2013 +0100

    Fix linking against libpthread

 libmemcached-fix-linking-with-libpthread.patch |   19 +++++++++++++++++++
 libmemcached.spec                              |    7 ++++++-
 2 files changed, 25 insertions(+), 1 deletions(-)
---
diff --git a/libmemcached-fix-linking-with-libpthread.patch b/libmemcached-fix-linking-with-libpthread.patch
new file mode 100644
index 0000000..e5e21c4
--- /dev/null
+++ b/libmemcached-fix-linking-with-libpthread.patch
@@ -0,0 +1,19 @@
+diff -up libmemcached-1.0.16/build-aux/ltmain.sh.orig libmemcached-1.0.16/build-aux/ltmain.sh
+--- libmemcached-1.0.16/build-aux/ltmain.sh.orig	2013-12-03 16:36:53.222107642 +0100
++++ libmemcached-1.0.16/build-aux/ltmain.sh	2013-12-03 16:37:35.770132249 +0100
+@@ -5664,6 +5664,15 @@ func_mode_link ()
+ 	    *" $arg "*) ;;
+ 	    * ) func_append new_inherited_linker_flags " $arg" ;;
+ 	esac
++	# As we are forced to pass -nostdlib to g++ during linking, the option
++	# -pthread{,s} is not in effect;  add the -lpthread to $deplist
++	# explicitly to link correctly.
++	if test "$tagname" = CXX -a x"$with_gcc" = xyes; then
++	  case "$arg" in
++	    -pthread*) func_append deplibs " -lpthread" ;;
++	  esac
++	fi
++
+ 	continue
+ 	;;
+ 
diff --git a/libmemcached.spec b/libmemcached.spec
index bcc61e6..e8bce7f 100644
--- a/libmemcached.spec
+++ b/libmemcached.spec
@@ -5,7 +5,7 @@
 Name:      libmemcached
 Summary:   Client library and command line tools for memcached server
 Version:   1.0.16
-Release:   1%{?dist}
+Release:   2%{?dist}
 License:   BSD
 Group:     System Environment/Libraries
 URL:       http://libmemcached.org/
@@ -30,6 +30,7 @@ BuildRequires: systemtap-sdt-devel
 %endif
 BuildRequires: libevent-devel
 
+Patch0: libmemcached-fix-linking-with-libpthread.patch
 
 %description
 libmemcached is a C/C++ client library and tools for the memcached server
@@ -71,6 +72,7 @@ you will need to install %{name}-devel.
 
 %prep
 %setup -q
+%patch0 -p1
 
 mkdir examples
 cp -p tests/*.{cc,h} examples/
@@ -174,6 +176,9 @@ rm -rf %{buildroot}
 
 
 %changelog
+* Tue Dec 03 2013 Ruben Kerkhof <ruben at rubenkerkhof.com> 1.0.16-2
+- Fix linking against libpthread as a workaround for libtool bug #661333
+
 * Mon Aug  5 2013 Remi Collet <remi at fedoraproject.org> - 1.0.16-1
 - revert to 1.0.16 for fedora 20
 


More information about the scm-commits mailing list