Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Mar 2006 09:58:00 +0100
From:      des@des.no (Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?=)
To:        Ade Lovett <ade@FreeBSD.org>
Cc:        cvs-ports@FreeBSD.org, cvs-all@FreeBSD.org, ports-committers@FreeBSD.org
Subject:   Re: cvs commit: ports/Mk bsd.autotools.mk
Message-ID:  <86lkvi8ynb.fsf@xps.des.no>
In-Reply-To: <C7DB396E-DEC9-4990-A7DA-499D5285344F@FreeBSD.org> (Ade Lovett's message of "Thu, 9 Mar 2006 07:39:32 -0800")
References:  <200602231043.k1NAhYlr080084@repoman.freebsd.org> <86irqpwy35.fsf@xps.des.no> <C7DB396E-DEC9-4990-A7DA-499D5285344F@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Ade Lovett <ade@FreeBSD.org> writes:
> On Mar 07, 2006, at 16:59 , Dag-Erling Sm=F8rgrav wrote:
> > .la files are useless on an ELF system
> Cite, please?  Given that around 35% of our libtool-using ports
> already installed .la files prior to this change, as well as
> extensive use of them in Linux and NetBSD's pkgsrc (both of which
> run on ELF-based systems, last time I checked), I'm sure any such
> critical problems would have been found by now.

The purpose of .la files is to record dependencies between libraries.
The ELF format stores these dependencies in the libraries themselves,
so the .la files serve no purpose, and it's actually harmful in some
cases because it hardcodes the path to the .so file, preventing
relocation of the library.

To be specific, let's say you build library A with --prefix=3D/usr/local
and install it with DESTDIR=3D/tmp/cross-build (so it ends up in
/tmp/cross-build/usr/local/lib/libA.{so,la}).  Next, you build library
B, which depends on library A, also with --prefix=3D/usr/local, and with
LD_LIBRARY_PATH set to /tmp/cross-build/usr/local/lib.  Libtool will
find the .la file, but that file has libdir set to /usr/local/lib, so
libtool will run ld with -l/usr/local/lib/libA.so, which won't work.
If you remove the .la file, libtool will run ld with -lA instead; ld
will obey your LD_LIBRARY_PATH, and everything will be fine.

DES
--=20
Dag-Erling Sm=F8rgrav - des@des.no



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86lkvi8ynb.fsf>