[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Problem with building static convenience libraries without --tag
From: |
Jakub Bogusz |
Subject: |
Problem with building static convenience libraries without --tag |
Date: |
Thu, 17 Apr 2003 22:52:02 +0200 |
User-agent: |
Mutt/1.4.1i |
I was trying to make static convenience library (to link into some
binary), and found following problem using libtool 1.5:
library is in C++, so it uses g++ compiler and libtool configuration for
CXX tag. When --tag=CXX is not passed (and thus autodetected based on
compiler name) I got:
| $ libtool --mode=link athlon-pld-linux-g++ -o libblah.la -static
| rm -fr .libs/libblah.a .libs/libblah.la
| rm -fr .libs/libblah.lax
| mkdir .libs/libblah.lax
| rm -fr .libs/libblah.lax/libstdc++.a
| mkdir .libs/libblah.lax/libstdc++.a
| (cd .libs/libblah.lax/libstdc++.a && ar x /usr/lib/./libstdc++.a)
| ar: /usr/lib/./libstdc++.a: No such file or directory
or (when trying to link with more libraries):
| $ libtool --mode=link athlon-pld-linux-g++ -o libblah.la -static -lgd
| rm -fr .libs/libblah.a .libs/libblah.la
| rm -fr .libs/libblah.lax
| mkdir .libs/libblah.lax
| rm -fr .libs/libblah.lax/libgd.a
| mkdir .libs/libblah.lax/libgd.a
| (cd .libs/libblah.lax/libgd.a && ar x /usr/lib/libgd.a)
| ar: /usr/lib/libgd.a: No such file or directory
I don't have static libraries installed and I think they shouldn't be
needed here (only dependencies should be added to libblah.la, to be used
when linking some program with libblah.la); even more, they are in fact
not needed if --tag=CXX is passed:
| $ libtool --mode=link --tag=CXX athlon-pld-linux-g++ -o libblah.la -static
| rm -fr .libs/libblah.a .libs/libblah.la
| ar cru .libs/libblah.a
| ranlib .libs/libblah.a
| creating libblah.la
| (cd .libs && rm -f libblah.la && ln -s ../libblah.la libblah.la)
(the same with -lgd added; libraries are added to dependency_libs in
libblah.la)
I found that this problem may be caused by the order of processing
libtool command line: when --tag=CXX is used, libtool tag config is
loaded earlier than if tagname is autodetected based on compiler.
-static option sets build_libtool_libs to "no" (overriding default
value "yes"), and when --tag=CXX is not passed, this setting is
overridden by "yes" set in CXX tag configuration...
(build_libtool_libs=yes later causes attempts to link shared libraries
into libtool convenience library)
Libtool version details:
| $ libtool --version
| ltmain.sh (GNU libtool) 1.5 (1.1220 2003/04/05 19:32:58)
|
| Copyright (C) 2003 Free Software Foundation, Inc.
| This is free software; see the source for copying conditions. There is NO
| warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
| PURPOSE.
--
Jakub Bogusz http://cyber.cs.net.pl/~qboosh/
PLD Linux http://www.pld.org.pl/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Problem with building static convenience libraries without --tag,
Jakub Bogusz <=