libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sysroot support in libtool


From: Richard Purdie
Subject: Re: sysroot support in libtool
Date: Sun, 13 Apr 2008 19:53:10 +0100

Hi Ralf,

On Sun, 2008-04-13 at 17:09 +0200, Ralf Wildenhues wrote:
> * Richard Purdie wrote on Sun, Apr 13, 2008 at 04:59:26PM CEST:
> > 
> > * the person who integrated libtool into OE has moved onto other things
> >   and the knowledge for a lot of the "magic" was lost
> > * we're stuck on an old version of libtool (1.5.10) which we know you 
> >   won't be interested in bugs against
> 
> > * this old version "works" [...]
> 
> No it doesn't.  If it did, you wouldn't be adopting dolt.
> OK, you put "works" in quotes, so I guess that's what you meant.

"works" means that with our patched 1.5.10 libtool OE/Poky can generate
working cross compiled binaries and images. Its in quotes since I don't
like the way we do it but having working builds with some ugliness
behind the scenes is better than ones that don't work!

dolt comes in purely as a speedup, it doesn't make the .la file and
sysroot situation better or worse.

> > In the meantime I will try and get Poky/OE using a much more recent
> > libtool, patched enough so builds continue to work as described above.
> > Once we get a modern version working it will be much easier to test
> > patches and improvements in libtool and from what I've read, we should
> > see some performance improvements which would be most welcome. We don't
> > have patches to add sysroot support, just the sed hacks I've mentioned
> > but if you'd be interested in proper sysroot support that is something
> > we'd be interested in collaborating on.
> 
> Even posting the sed hacks or the diffs against 1.5.10 that you were
> using (both to libtool-patches, please) are better than nothing.

I'll post here first, since I don't class any of these are ready to
apply and really need discussion. If you still feel libtool-patches is
more appropriate for that tell me and I'll switch lists though.

The patches we're using are publicly available as:
http://svn.o-hand.com/view/poky/trunk/meta/packages/libtool/libtool-1.5.10/

I've run through each with a quick description of what it does

3figures.patch - a better version was merged, not needed with 2.2.2

add_dolt.patch - hacks dolt into libtool.m4 instead of patching every
configure.ac. Inappropriate for upstream, mentioned for reference only.

autotools.patch - Make the old libtool work with more modern autotools.
Not needed with 2.2.2.

install-path-check.patch - OE used to have a staging layout which didn't
match the target system. Since we use sysroot this shouldn't be needed
anymore.

libdir-la.patch - See comments in the patch. Doesn't add libdir to the
search path, don't complain about 'moved' files, don't replace
uninstalled with installed libraries

libdir-la2.patch - Improves on the above to stop libdir leaking into
search paths and checking more locations in the installed=no case.

nmedit_fix.patch - Call host-triplet-nmedit, not just "nmedit"

nousrlib.patch - Stop libdir leaking into linker flags

prefix.patch - Rename libtool to be prefixed by the host triplet which
makes it much more obvious when the wrong libtool is being used and is
in line with autotools wanting cross tool names prefixed with the
triplet.

sedvar.patch - Fixes some issue we saw when $SED wasn't set

tag.patch - The tag errors were breaking things for no good reason so we
turned the error into a warning

uclibc.patch - Tweaks to libtool.m4 to support uclibc


I don't have the full background on all of these and have only checked
whether some are needed against 2.2.2, I'll aim to do the rest soon and
try to get 2.2.2 working. The core patches are the libdir-la.patch,
lidir-la2.patch and prefix.patch, all of which I know are still needed.

The sed magic I mentioned is in
http://svn.o-hand.com/view/poky/trunk/meta/classes/base.bbclass?rev=4064&view=markup

specifically:

sed -e 's/^installed=yes$/installed=no/' \
     -e 
'/^dependency_libs=/s,${WORKDIR}[[:alnum:]/\._+-]*/\([[:alnum:]\._+-]*\),${STAGING_LIBDIR}/\1,g'
 \
     -e "/^dependency_libs=/s,\([[:space:]']+\)${libdir},\1${STAGING_LIBDIR},g" 
\
     $dotlai >$destpath/$libname.la

which changes installed=yes to installed=no and cleans up
dependency_libs so it only refers to 'staging' (the sysroot), not the
work directories (which are temporary in nature) or libdir (which are
binaries from the wrong architecture).

> Proper sysroot support in Libtool would be very welcome, but
> unfortunately it won't be easy.  Of course there are more constraints:
> it should work right in most practical cases, not just the ones your
> package cares about.  Since it cannot be made to work on some systems
> due to linker and binary file format limitations, it should degrade
> gracefully on those systems.
> 
> I've tried it a couple of years ago, but gave up since I figured it
> would take me all remaining weekends of the year to do.

I agree it won't be easy. If I knew it stood a chance of being accepted
into libtool and/or that others were prepared to help with it, that
might encourage me to start writing some patches though. It has the
advantage of being opt in since if sysroot isn't set, it won't change
the behaviour. On systems where a sysroot isn't possible due to whatever
constraints, it could just say so...

Cheers,

Richard





reply via email to

[Prev in Thread] Current Thread [Next in Thread]