bug-libtool
[Top][All Lists]
Advanced

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

Re: link library with indirect dep-lib fail on mingw (libtool 1.2.26)


From: Roumen Petrov
Subject: Re: link library with indirect dep-lib fail on mingw (libtool 1.2.26)
Date: Wed, 27 Feb 2008 21:52:16 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.12) Gecko/20080212 SeaMonkey/1.1.8

Roumen Petrov wrote:
Test case:
- library foo2 depend from foo1
- program foo depend from foo2 (that depend from foo1)
- library foo3 depend from foo2 (that depend from foo1)
(test case attached as file bootstrap.sh.gz)

On mingw (cross-compilation) the program foo is linked but library foo3 fail.


Mingw (--prefix=/tmp/test/foo/mingw):
1.1) program foo:
$ /bin/sh ./libtool --tag=CC --mode=link i386-mingw32msvc-gcc -g -O2 -no-undefined -avoid-version -o foo.exe foo.o lib2/libfoo2.la
....
$ i386-mingw32msvc-gcc -g -O2 -o .libs/foo.exe foo.o lib2/.libs/libfoo2.dll.a /<ABSPATH>/build-mingw/lib1/.libs/libfoo1.dll.a -L/tmp/test/foo/mingw/lib

1.2) library foo3:
$ /bin/sh ../libtool --tag=CC --mode=link i386-mingw32msvc-gcc -g -O2 -no-undefined -avoid-version -o libfoo3.la -rpath /tmp/test/foo/mingw/lib foo.lo ../lib2/libfoo2.la
....
i386-mingw32msvc-gcc -shared .libs/foo.o ../lib2/.libs/libfoo2.dll.a -L/<ABSPATH>/build-mingw/lib1/.libs -o .libs/libfoo3.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/libfoo3.dll.a
....
.libs/foo.o: In function `foo3':
..../lib3/foo.c:6: undefined reference to `_foo1'



Similar but on linux (--prefix=/tmp/test/foo/linux):
2.1) program foo:
/bin/sh ./libtool --tag=CC --mode=link gcc -g -O2 -o foo foo.o lib2/libfoo2.la gcc -g -O2 -o .libs/foo foo.o lib2/.libs/libfoo2.so /<ABSPATH>/build-linux/lib1/.libs/libfoo1.so -Wl,--rpath -Wl,/tmp/test/foo/linux/lib

2.2) library foo3:
/bin/sh ../libtool --tag=CC --mode=link gcc -g -O2 -o libfoo3.la -rpath /tmp/test/foo/linux/lib foo.lo ../lib2/libfoo2.la
...
gcc -shared .libs/foo.o -Wl,--rpath -Wl,/<ABSPATH>/build-linux/lib2/.libs -Wl,--rpath -Wl,/tmp/test/foo/linux/lib ../lib2/.libs/libfoo2.so -L/<ABSPATH>/build-linux/lib1/.libs -Wl,-soname -Wl,libfoo3.so.0 -o .libs/libfoo3.so.0.0.0


Common is that when link programs all dep-libs are expanded and passed to compiler as non-installed dependent are with absolute path.

If is linked library direct dependent lib and path to indirect are passed to compiler but indirect library is missing on command line.


Roumen


It is fine with head version:

/bin/sh ../libtool --tag=CC --mode=link i386-mingw32msvc-gcc -g -O2 -no-undefined -avoid-version -o libfoo3.la -rpath /tmp/test/foo/mingw/lib foo.lo ../lib2/libfoo2.la
....
libtool: link: i386-mingw32msvc-gcc -shared .libs/foo.o -L/<ABSPATH>/build-mingw/lib1/.libs ../lib2/.libs/libfoo2.dll.a /<ABSPATH>/build-mingw/lib1/.libs/libfoo1.dll.a -o .libs/libfoo3.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/libfoo3.dll.a


The -L flag and <ABSPATH> seems to me extra for non-installed, but the third library is linked now :) .


Roumen




reply via email to

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