Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 276873 - net-libs/rb_libtorrent: breaks with forced --as-needed
Summary: net-libs/rb_libtorrent: breaks with forced --as-needed
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High QA (vote)
Assignee: Gentoo net-p2p team
URL: http://www.gentoo.org/proj/en/qa/asne...
Whiteboard:
Keywords:
: 298000 (view as bug list)
Depends on:
Blocks: as-needed
  Show dependency tree
 
Reported: 2009-07-07 08:37 UTC by Diego Elio Pettenò (RETIRED)
Modified: 2010-03-27 17:30 UTC (History)
4 users (show)

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


Attachments
Build log (rb_libtorrent-0.14.4-r1:20090707-015139.log,283.97 KB, text/plain)
2009-07-07 08:37 UTC, Diego Elio Pettenò (RETIRED)
Details
fixing as-needed issues (rb_libtorrent-0.14.8-as-needed-fix.patch,377 bytes, patch)
2010-02-14 15:08 UTC, Kacper Kowalik (Xarthisius) (RETIRED)
Details | Diff
0.14.9-configure-ldflags-asneeded-fix.patch (0.14.9-configure-ldflags-asneeded-fix.patch,520 bytes, patch)
2010-03-24 00:21 UTC, Doktor Notor
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Diego Elio Pettenò (RETIRED) gentoo-dev 2009-07-07 08:37:33 UTC
I'm reporting this bug because the package in summary fails to build when forcing --as-needed on through spec files (check out http://blog.flameeyes.eu/2008/11/14/problems-and-mitigation-strategies-for-as-needed for details).

Please note that this bug _might_ apply to -Wl,--as-needed in LDFLAGS as well; in both cases it should be fixed. Also, if this is due to the package in question not respecting user-defined LDFLAGS, you should get to fix that too.

Check the attached build log.

Thanks,
Diego
Comment 1 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-07-07 08:37:51 UTC
Created attachment 197003 [details]
Build log
Comment 2 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-12-25 18:30:29 UTC
*** Bug 298000 has been marked as a duplicate of this bug. ***
Comment 3 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-12-25 18:31:43 UTC
The library is definitely broken, it's not a problem of tests only.
Comment 4 Ben de Groot (RETIRED) gentoo-dev 2010-01-14 12:41:03 UTC
I'm very sympathetic to fixing as-needed issues, but this goes a bit over my head. So some help here would be very welcome. 

Is the undefined reference to clock_gettime the only issue here? And would it then be enough to add `append-ldflags -lrt`?
Comment 5 Diego Elio Pettenò (RETIRED) gentoo-dev 2010-01-14 12:45:34 UTC
No. You do the append-ldflags and you leave it as broken as it was before with an extra QA warnings.

Patch the Makefile.am to add -lrt to the LIBADD for the library.
Comment 6 Ben de Groot (RETIRED) gentoo-dev 2010-01-14 16:04:24 UTC
I added a patch to rb_libtorrent-0.14.8-r1.ebuild (revision 1.2). Please let me know if that fixes the issue.
Comment 7 Kacper Kowalik (Xarthisius) (RETIRED) gentoo-dev 2010-02-14 15:08:48 UTC
Created attachment 219641 [details, diff]
fixing as-needed issues

(In reply to comment #6)
> I added a patch to rb_libtorrent-0.14.8-r1.ebuild (revision 1.2). Please let me
> know if that fixes the issue.
I doesn't work for me. I suppose it should be target_LIBADD. Nevertheless, the supplied patch should do the trick.
Comment 8 Doktor Notor 2010-03-23 23:56:22 UTC
Well, this doesn't fix the issue.

This is from trying to run net-p2p/deluge-1.2.2:

Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/deluge/ui/gtkui/gtkui.py", line 275, in _on_reactor_start
    client.start_classic_mode()
  File "/usr/lib/python2.6/site-packages/deluge/ui/client.py", line 531, in start_classic_mode
    self._daemon_proxy = DaemonClassicProxy(self.__event_handlers)
  File "/usr/lib/python2.6/site-packages/deluge/ui/client.py", line 408, in __init__
    self.__daemon = deluge.core.daemon.Daemon(classic=True)
  File "/usr/lib/python2.6/site-packages/deluge/core/daemon.py", line 136, in __init__
    from deluge.core.core import Core
  File "/usr/lib/python2.6/site-packages/deluge/core/core.py", line 36, in <module>
    from deluge._libtorrent import lt
  File "/usr/lib/python2.6/site-packages/deluge/_libtorrent.py", line 59, in <module>
    import libtorrent as lt
ImportError: /usr/lib/libtorrent-rasterbar.so.5: undefined symbol: clock_gettime

Only happens w/ LD_AS_NEEDED="1"
Comment 9 Samuli Suominen (RETIRED) gentoo-dev 2010-03-24 00:01:49 UTC
(In reply to comment #8)
> Well, this doesn't fix the issue.

"this" ? The current in Portage, or the patch in Comment #7 ?
Comment 10 Doktor Notor 2010-03-24 00:21:51 UTC
Created attachment 225059 [details, diff]
0.14.9-configure-ldflags-asneeded-fix.patch

(In reply to comment #9)
> "this" ? The current in Portage, or the patch in Comment #7 ?

Sorry, not clear enough; this == current portage ;) Comment #7 works fine. 

Attached an updated patch for 0.14.9, also includes the 0.14.6-configure-ldflags-fix.patch since I really dislike the patch-on-top-of-patched-file approach.
Comment 11 Ben de Groot (RETIRED) gentoo-dev 2010-03-27 17:30:23 UTC
I've applied this latest patch to 0.14.9-r1. Feel free to reopen if the problem reappears.