[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Suppressing --whole-archive
From: |
Barthelemy von Haller |
Subject: |
Re: Suppressing --whole-archive |
Date: |
Thu, 26 Feb 2009 13:37:37 +0100 |
User-agent: |
Thunderbird 2.0.0.19 (X11/20081209) |
Hello Ralf,
First of all, I apologize for the very late reply, but I had to leave
work for personal reasons for more than a month.
Ralf Wildenhues a écrit :
Hello Barthelemy,
* Barthelemy von Haller wrote on Mon, Jan 05, 2009 at 11:56:53AM CET:
I found a message which corresponds exactly to my problem :
http://osdir.com/ml/gnu.libtool.general/2004-02/msg00093.html
Not really.
Ok :-) sorry, I am a beginner with autotools, I took over a project
which uses automake and autotools but without any background with these
tools.
My problem appears when building a shared library using, amongst others,
static libraries. It generates something like :
Please always post the input command line that is given to libtool,
that gives valuable hints as to whether libtool generated the
--whole-archive arguments.
Ok, so here is what is output before the command I pasted in my first email.
/bin/sh ../../libtool --mode=link g++ -fPIC -Wall -Wextra -Wshadow
-Wredundant-decls -g -O2 -o libAmoreCore.la -rpath /opt/amore/lib
-release 1.1 -L/local/root/lib -L/date/monitoring/Linux -lmonitor
-L/usr/local/lib -lshift -L/date/db/Linux -lDb -L/date/infoLogger/Linux
-lInfo -rdynamic -L/usr/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm
-lmygcc -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree
-lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lGui
-pthread -lm -ldl -rdynamic -rdynamic -L/usr/lib/mysql -lmysqlclient -lz
-lcrypt -lnsl -lm -lmygcc -lRMySQL CoreDict.lo StringUtility.lo
Event.lo MOMessage.lo MonitorInterface.lo MonitorObject.lo
MySQLServer.lo PoolInterface.lo RuntimeModule.lo SocketInterface.lo
TDATEEventParser.lo Run.lo Session.lo LogBook.lo InfoLogger.lo
RunControl.lo AmoreDA.lo AmoreDABackEnd.lo
g++ -shared -nostdlib
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../crti.o
/usr/lib/gcc/i386-redhat-linux/4.1.2/crtbeginS.o .libs/CoreDict.o
.libs/Event.o .libs/LogInterface.o .libs/Map.o .libs/MOMessage.o
.libs/MonitorInterface.o .libs/MonitorObject.o .libs/MySQLServer.o
.libs/PoolInterface.o .libs/RuntimeModule.o .libs/SocketInterface.o
.libs/TDATEEventParser.o .libs/Run.o .libs/Session.o .libs/LogBook.o
.libs/InfoLogger.o .libs/RunControl.o .libs/AmoreDA.o
.libs/AmoreDABackEnd.o -Wl,--whole-archive
/usr/lib/mysql/libmysqlclient.a /usr/lib/mysql/libz.a
-Wl,--no-whole-archive -L/opt/root/lib -L/date/monitoring/Linux
-lmonitor -L/usr/local/lib -lshift -L/date/db/Linux -lDb
-L/date/infoLogger/Linux -lInfo -L/usr/lib/mysql -lCore -lCint -lRIO
-lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix
-lPhysics -lMathCore -lThread -lGui -pthread -ldl -lcrypt -lnsl -lRMySQL
-L/usr/lib/gcc/i386-redhat-linux/4.1.2
-L/usr/lib/gcc/i386-redhat-linux/4.1.2/../../.. -lstdc++ -lm -lc -lgcc_s
/usr/lib/gcc/i386-redhat-linux/4.1.2/crtendS.o
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../crtn.o -Wl,-soname
-Wl,libAmoreCore-1.0.so -o .libs/libAmoreCore-1.0.so
Where you can see, in the middle :
-Wl,--whole-archive /usr/lib/mysql/libmysqlclient.a
/usr/lib/mysql/libz.a -Wl,--no-whole-archive
The problem is that those two static libraries contain similar symbols
leading to a lot of errors such as
/usr/lib/mysql/libz.a(adler32.o): In function `adler32':
OK, this is kind of weird. Libtool only uses whole-archive for
convenience archives, and those are normally not installed.
Libtool has a conceptual difference between static libraries and
convenience archives; the former are considered normal libraries,
just not shared, the latter are intended to be incorporated "as a
whole" into a final output, be that a library (normal) or a program.
It is recommended against installing such a convenience library,
and actually, one has to hack a bit in order to do so.
Do files /usr/lib/mysql/libmysqlclient.la and /usr/lib/mysql/libz.la
exist, and if yes, could you please post their contents?
Yes they exist.
*********** /usr/lib/mysql/libmysqlclient.la *************
# libmysqlclient.la - a libtool library file
# Generated by ltmain.sh - GNU libtool 1.5.24 (1.1220.2.455 2007/06/24
02:13:29)#
# Please DO NOT delete this file!
# It is necessary for linking the library.
# The name that we can dlopen(3).
dlname=''
# Names of this library.
library_names=''
# The name of the static archive.
old_library='libmysqlclient.a'
# Libraries that this one depends upon.
dependency_libs=' -lpthread -lpthread -lpthread -lpthread -lpthread -lpthread
-lpthread -lpthread -lcrypt -lnsl -lm'
# Version information for libmysqlclient.
current=16
age=0
revision=0
# Is this an already installed library?
installed=yes
# Should we warn about portability when linking against -modules?
shouldnotlink=no
# Files to dlopen/dlpreopen
dlopen=''
dlpreopen=''
# Directory that this library needs to be installed in:
libdir='/usr/lib/mysql'
*********** end of /usr/lib/mysql/libmysqlclient.la *************
*********** /usr/lib/mysql/libz.la *************
# libz.la - a libtool library file
# Generated by ltmain.sh - GNU libtool 1.5.24 (1.1220.2.455 2007/06/24
02:13:29)#
# Please DO NOT delete this file!
# It is necessary for linking the library.
# The name that we can dlopen(3).
dlname=''
# Names of this library.
library_names=''
# The name of the static archive.
old_library='libz.a'
# Libraries that this one depends upon.
dependency_libs=' -lcrypt -lnsl -lm'
# Version information for libz.
current=0
age=0
revision=0
# Is this an already installed library?
installed=yes
# Should we warn about portability when linking against -modules?
shouldnotlink=no
# Files to dlopen/dlpreopen
dlopen=''
dlpreopen=''
# Directory that this library needs to be installed in:
libdir='/usr/lib/mysql'
*********** end of /usr/lib/mysql/libz.la *************
Thanks,
Ralf
It is me who must thank you !
Barth
--
Barthélémy von Haller
address@hidden
CERN PH-AID (ALICE DAQ)
- Re: Suppressing --whole-archive,
Barthelemy von Haller <=