[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Suppressing --whole-archive
From: |
Ralf Wildenhues |
Subject: |
Re: Suppressing --whole-archive |
Date: |
Mon, 5 Jan 2009 19:21:11 +0100 |
User-agent: |
Mutt/1.5.17+20080114 (2008-01-14) |
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.
> 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.
> 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?
Thanks,
Ralf