Bug 1037707 - failure to link against libmemcached
Summary: failure to link against libmemcached
Alias: None
Product: Fedora
Classification: Fedora
Component: libmemcached
Version: rawhide
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Remi Collet
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2013-12-03 15:58 UTC by Ruben Kerkhof
Modified: 2014-09-08 13:52 UTC (History)
4 users (show)

Fixed In Version: libmemcached-1.0.16-2.fc20
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2013-12-23 03:44:31 UTC
Type: Bug

Attachments (Terms of Use)
Fix linking against libpthread (2.47 KB, application/mbox)
2013-12-03 15:58 UTC, Ruben Kerkhof
no flags Details

Description Ruben Kerkhof 2013-12-03 15:58:40 UTC
Created attachment 832188 [details]
Fix linking against libpthread

Description of problem:

Somewhere between libmemcached-1.0.8 and libmemcached-1.0.16 libmemcached.so stopped to link to libpthread properly.
This turns out to be a bug in libtool (#661333), or gcc depending on how you look at it.

The following code works with libmemcached-1.0.8:
[root@vm ~]# cat test.c 
#include <libmemcached/memcached.h>

int main()
	memcached_st ms;
	return 0;
[root@vm ~]# gcc -o test test.c -lmemcached

And returns an error with libmemcached-1.0.16:
[root@vm ~]# gcc -o test test.c -lmemcached
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../lib64/libmemcached.so: undefined reference to `pthread_once'
collect2: error: ld returned 1 exit status

I've attached a patch which works around bug #661333. I'd appreciate it if you can apply the patch so I can enable the memcachec plugin in collectd.

Comment 1 Remi Collet 2013-12-03 16:28:52 UTC
Thanks for the patch, I will have deeper look ASAP

Have you reported this upstream ?
Having a link to upstream bug will be nice (required by Guidelines)

Comment 2 Ruben Kerkhof 2013-12-03 17:41:39 UTC
Hi Remi,

Thanks for looking into it.
I'll report it upstream as well as soon as I can find my Launchpad account.

Comment 3 Fedora Update System 2013-12-14 07:14:52 UTC
libmemcached-1.0.16-2.fc20 has been submitted as an update for Fedora 20.

Comment 4 Fedora Update System 2013-12-14 07:15:03 UTC
libmemcached-1.0.16-2.fc19 has been submitted as an update for Fedora 19.

Comment 5 Remi Collet 2013-12-14 07:17:59 UTC
Update pushed to testing (F19 and F20).

If you need a buildroot overrides, I think you can submit it yourself, else, just ask.

NB: if you plan to also build collectd for EPEL-7, probably you will hit the same issue, so probably you need to file a RHEL-7 bug.

Comment 6 Fedora Update System 2013-12-15 03:29:16 UTC
Package libmemcached-1.0.16-2.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing libmemcached-1.0.16-2.fc20'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2013-12-23 03:44:31 UTC
libmemcached-1.0.16-2.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2013-12-23 03:48:13 UTC
libmemcached-1.0.16-2.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.