Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 533548 - net-misc/ntp-4.2.8-r1 should depend on dev-libs/libevent[threads] - ld: cannot find -levent_pthreads
Summary: net-misc/ntp-4.2.8-r1 should depend on dev-libs/libevent[threads] - ld: canno...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-25 20:00 UTC by Michael Hofmann
Modified: 2015-02-28 22:59 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Add threads use flag (ntp.patch,1.22 KB, patch)
2014-12-27 16:54 UTC, Mike Gilbert
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Hofmann 2014-12-25 20:00:37 UTC
emerge =net-misc/ntp-4.2.8-r1 returns the error below if libevent was compiled without USE-flag "threads":

   /usr/lib/gcc/i686-pc-linux-gnu/4.8.3/../../../../i686-pc-linux-gnu/bin/ld: cannot find -levent_pthreads

If libevent was compiled with USE flag "threads", emerge =net-misc/ntp-4.2.8-r1 works fine.

Seen on: amd64 and x86-hardened

Proposed solution: The ebuilds for net-misc/ntp-4.2.8* should explicitly require libevent compiled with USE-flag "threads"

Reproducible: Always
Comment 1 Maxim Britov 2014-12-26 12:59:14 UTC
Confirm it.
I reported this there: https://bugs.gentoo.org/show_bug.cgi?id=533076#c17
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2014-12-27 11:38:45 UTC
*** Bug 533670 has been marked as a duplicate of this bug. ***
Comment 3 Mike Gilbert gentoo-dev 2014-12-27 16:41:43 UTC
ntp's configure script has a couple of flags that may be relevant:

  --enable-thread-support s use threads (+ if available)
  --with-threads          with threads [auto]

So, instead of depending on libevent[threads] unconditionally, it may be possible to toggle threads support in ntp instead.
Comment 4 Mike Gilbert gentoo-dev 2014-12-27 16:54:58 UTC
Created attachment 392522 [details, diff]
Add threads use flag

The --enable-thread-support flag seems to do the trick. Here is my suggested solution.
Comment 5 Michael Hofmann 2014-12-27 18:10:48 UTC
@Mike Gilbert: nice patch! 

I can confirm that Mike's patch fixes the problem. 
With Mike's patch, ntp can be build successfully with both variants: 

   USE="threads" emerge --oneshot libevent ntp
   USE="-threads" emerge --oneshot libevent ntp

Thanks!
Comment 6 Thomas Beutin 2014-12-28 14:52:03 UTC
(In reply to Michael Hofmann from comment #5)
[...]
> I can confirm that Mike's patch fixes the problem. 

i can confirm this for non-threaded system(s) too.
Comment 7 Tobias Sager 2015-01-19 14:27:39 UTC
Anything preventing this from going in and live?
Comment 8 Wim van Ravesteijn 2015-02-26 08:39:50 UTC
Are we supposed to create our own fork to get the issue fixed, or will the package maintainers take care of this? I've several servers running a vulnarable NTPD because the default packages don't provide a fix for this problem. Would be nice if the provided patch is included, shouldn't take more than 5 minutes work.
Comment 9 Mike Gilbert gentoo-dev 2015-02-26 18:22:30 UTC
(In reply to Wim van Ravesteijn from comment #8)

Please remember that we are all volunteers here, and you are not entitled to any form of support from us. Go buy a Red Hat contract if you require some SLA.

Anyway, a very simple workaround for you would be to enable the threads use flag on libevent.
Comment 10 Mike Gilbert gentoo-dev 2015-02-26 18:30:22 UTC
+  26 Feb 2015; Mike Gilbert <floppym@gentoo.org> ntp-4.2.8-r2.ebuild:
+  Add threads use flag, bug 533548.
Comment 11 SpanKY gentoo-dev 2015-02-26 19:53:22 UTC
(In reply to Wim van Ravesteijn from comment #8)

not only to echo Mike's sentiments, but why exactly would you need to fork to workaround this ?  reinstall libevent once by hand and you're done.  or add the flag to EXTRA_ECONF for the package's env.  or tweak your USE flags.  please refrain from making more out of an issue than there really is to it.
Comment 12 Wim van Ravesteijn 2015-02-28 22:59:25 UTC
(In reply to Mike Gilbert from comment #9)

Sorry for pushing to get a solution in portage tree, but the bug was open for almost 2 months while a solution (patch) was already proposed. I know you are all volunteers, but I don't have the access to build the fix myself. I understand you'll not fix this issue within an hour after it has been reported, but 2 months is too long if you ask me.

In any case, thanks a lot for the fix, compiling now goes fine without changing any use flags. Tested on both x86 and amd64.