Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 267898 - [PATCH] revdep-rebuild fails to consider -l* in dependency_libs in .la files
Summary: [PATCH] revdep-rebuild fails to consider -l* in dependency_libs in .la files
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 268001
  Show dependency tree
 
Reported: 2009-04-29 17:19 UTC by Peter Alfredsen (RETIRED)
Modified: 2009-05-01 03:26 UTC (History)
0 users

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


Attachments
revdep-rebuild-la.patch (revdep-rebuild-la.patch,1.57 KB, patch)
2009-04-29 17:21 UTC, Peter Alfredsen (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Alfredsen (RETIRED) gentoo-dev 2009-04-29 17:19:03 UTC
.la files can contain -l$library arguments in the dependency_libs variable which the consumer-library itself does not directly link against. If $library is then removed, linking against the consumer-library with libtool will produce errors despite the consumer-library .so not being directly linked with $library.

Solution: Expand the -l* arguments and check if a .so or .a exists to link to, mark file broken otherwise.
Comment 1 Peter Alfredsen (RETIRED) gentoo-dev 2009-04-29 17:21:03 UTC
Created attachment 189875 [details, diff]
revdep-rebuild-la.patch

Patch against svn. Just s/gawk/awk/ to make it apply against gentoolkit-0.2.4.2-r1
Comment 2 Peter Alfredsen (RETIRED) gentoo-dev 2009-04-29 18:12:03 UTC
PS: This will only become more of a problem as more people use the dev-util/lafilefixer tool to fix .la files.
Comment 3 Paul Varner (RETIRED) gentoo-dev 2009-04-30 14:23:30 UTC
$ svn commit -m "Add patch from loki_val to check -l dependencies in .la files (Bug #267898)" ChangeLog src/revdep-rebuild/revdep-rebuild
Sending        ChangeLog
Sending        src/revdep-rebuild/revdep-rebuild
Transmitting file data ..
Committed revision 555.

Do you know of any packages off hand that do this that I can use to test?
Comment 4 Peter Alfredsen (RETIRED) gentoo-dev 2009-04-30 16:31:40 UTC
(In reply to comment #3)
> $ svn commit -m "Add patch from loki_val to check -l dependencies in .la files
> (Bug #267898)" ChangeLog src/revdep-rebuild/revdep-rebuild
> Sending        ChangeLog
> Sending        src/revdep-rebuild/revdep-rebuild
> Transmitting file data ..
> Committed revision 555.
> 
> Do you know of any packages off hand that do this that I can use to test?

nano /usr/lib/libX11.la
At the end of dependency_libs add -lgoobledegook
Without the patch, revdep-rebuild will not detect the problem. Packages that , directly or indirectly, pull in /usr/lib/libX11.la with libtool will fail to build, complaining of missing -lgoobledegook.
For example:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lgooblededook

With the patch, libX11 is marked broken and rebuilt.
Comment 5 Peter Alfredsen (RETIRED) gentoo-dev 2009-04-30 21:30:58 UTC
With forced --as-needed, this is a case of what I'm talking about:
loki ~ # ldd -r /usr/lib64/libX11-xcb.so
	linux-vdso.so.1 =>  (0x00007fff08bfe000)
	libc.so.6 => /lib/libc.so.6 (0x00007f380050d000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f3800a88000)
loki ~ # grep dependency_libs /usr/lib64/libX11-xcb.la
dependency_libs=' -L/usr/lib64 -lX11 -lxcb-xlib -lxcb -lXau -lXdmcp -ldl'

(This system also has some extra .la removal stuff, so YMMV.)
Comment 6 Paul Varner (RETIRED) gentoo-dev 2009-05-01 03:26:25 UTC
Released in gentoolkit-0.2.4.3