FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Development

 
 
LinkBack Thread Tools
 
Old 11-26-2010, 02:52 PM
"Richard W.M. Jones"
 
Default libtool & dependency_libs in *.la files

[Apologies if this has been covered before, but I cannot find anything
in the archives]

When building a package I noticed that binaries in the package were
still getting unnecessary DT_NEEDED entries. Example:

binary ---> depends only on libfoo.so
|
| libfoo depends on
`----> libbar.so

but the binary was getting built with DT_NEEDED entries for both
'libfoo.so' and 'libbar.so', which is wrong.

ld had the '--no-add-needed' flag, so ld wasn't adding the extra
DT_NEEDED entry. (See:
http://fedoraproject.org/wiki/UnderstandingDSOLinkChange )

I tracked this down to our old friend libtool. Basically because the
binary and the library were being built out of the same source tree,
there was a 'libfoo.la' file which contained:

dependency_libs='libbar.so'

and this causes libtool to decide to "helpfully" add -lbar to the
linker command line, even though it is completely unnecessary.

(This is not a problem if libfoo and the binary were in separate
source packages, because we already nuke the *.la files, which avoids
this brokenness across different packages. The problem is
specifically confined to the case where binaries and libraries are
built from the *same* source package).

I was able to work around this by adding a libtool wrapper which set
dependency_libs=' in the *.la file.

I notice that Debian, Ubuntu and Gentoo have proposed something
similar:

http://wiki.debian.org/ReleaseGoals/LAFileRemoval
http://lists.debian.org/debian-devel/2009/08/msg00783.html
http://lists.debian.org/debian-release/2009/08/msg00217.html
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=586082

except they are unilaterally modifying libtool downstream instead of
using my hackish wrapper, which is a better idea. Apparently either
no one has tried to get this upstream, or libtool developers weren't
listening.

Rich.

--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-top is 'top' for virtual machines. Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://et.redhat.com/~rjones/virt-top
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 11-26-2010, 03:06 PM
"Richard W.M. Jones"
 
Default libtool & dependency_libs in *.la files

Even better, fixing libtool revealed some bugs (missing -llibs).

Rich.

--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-top is 'top' for virtual machines. Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://et.redhat.com/~rjones/virt-top
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 

Thread Tools




All times are GMT. The time now is 03:02 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org