Hi,


It happens with libtool timestamp 1.700, but not with 1.695.
the error message is something like that:

gcc -shared l4.lo -Wl,--whole-archive ./.libs/libl3.al
-Wl,--no-whole-archive /usr/lib/libl2.la /usr/lib/libl1.la
./.libs/libl3.al -lm -lc -Wl,-soname -Wl,l
/usr/lib/libl2.la: file not recognized: File format not recognized

Libtool has failed to substitute the .la names, which it picks up from
dependency_libs, into the correct .so names. This happens in the following
case:

(1) You have Shared lib l1 and shared lib l2, depending on l1, both
installed
in /usr/lib (or one of sys_lib_search_path).

(2) Then you try to make a convenience lib (l3), depending on l2, and a
shared lib l4 which includes l3

In step (2) makeing l3, the libl3.la file picks up the "/usr/lib/libl1.la"
dependency_lib from /usr/lib/libl2.la and additionally includes
"/usr/lib/libl2.la" as dependency_lib. Note that this does not happen if
l1/l2 are not installed into /usr/lib but in some other place, and only
-L/someotherplace gives the path to -ll1 -ll2. That may be another error.

Anyway, after succesfully making l3, the linking of l4 fails. What
happens, is that libtool searches libl3.la, sees in its dependency_libs
"/usr/lib/libl2.la /usr/lib/libl1.la", and tries to give that to the
command line to gcc.

If l1/l2 are not installed into /usr/lib, libtool fails to see the .la
files (lib_search_path gets reset before pass link, so it only contains
sys_lib_search_path, but no additionally (with -L) specified dirs), and
consuquently does not include them into the libl3.la file, but merely a
"-l2". In that case the linking of l4 is successful, as no .la files
disturb the link command.

So I think there are two errors manifesting here:
1) libtool can't find installed .la files if they are not in
   sys_lib_search_path, and so does not pick up dependencies into the
   actual target .la file
2) if in convenience libs .la files are in dependency_libs, libtool does
   not substitute them with the real libraries

Note, that it not happened with 1.695. I think the introduction of the
"conv" pass has some nits.

The attachment demonstrates the problem. Its a stripped down and changed
version of the depmod-test. Simply untar it in the libtool topdir (making
a failure dir), then:

% cd failure
% cd depmod
% make -f Makefile.cvs ; configure --prefix=/usr ; make
% sudo make install
% cd ../l3
% make -f Makefile.cvs ; configure --prefix=/usr
% make
error appears


Ciao,
Michael.

failure.tar.gz

Reply via email to