On Thu, 6 Jan 2005, David Berry wrote:
> Peter,
>
> > on a related issue, I tested building AST under Cygwin with the new pass2
> > scheme and it doesn't work. Libtool is way too clever and spots the slight
> > of hand and just removes the repeated library, which isn't so good. What
> > we actually need to do is edit the libast_pass2.la file to reference the
> > symbolic links, not the original files. Anyone know of a standard way to
> > do that? Alternatively can we create a deep-copy of a libtool library
> > (without needing to recompile all the modules)?
>
> Not sure I understand this. At what point does libtool remove the repeated
> libraries?
David,
during the link stage, which is now managed by libtool, so that's out of
our hands. Having cyclic dependencies in the linking stage is seen as bad
style and a possible portability problem, so libtool doesn't try to
support them.
> They are created using the install-exec-hook target in Makefile.am and
> so should be more or less the last thing that happens. I guess the time
> may have come for me to admit the existence of libtool and find out
> something about it...
Since I'm assuming nothing can be done about the cyclic bit (is that
really true, or just inconvenient?), the lesson begins. Look at the
content of a .la file. You'll see this is just a text file that describes
the related libraries, static and dynamic. When you direct libtool to use
a library during linking let's say -last, it looks for the related .la
file parses that and picks out the full names of the libraries to use,
either /star/lib/libast.so(.xxx) or /star/lib/libast.a in this case,
depending on the context and availability (if there is no .la file it just
leaves the command unprocessed for ld to deal with, which is where we
started, just having the pass2 softlink to the .a library). When it sees
such a file repeated in the link it is not picked up.
So we either need to cure the cyclic problem, or create .la files that
point at the softlinks, not the original files, as a straight copy does.
It's also possible that not linking the .la files might work (so ld can
see the .a and .so softlinks directly).
Cheers,
Peter.
|