libtool
[Top][All Lists]
Advanced

[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: Mon, 5 Jan 2009 11:56:53 +0100
User-agent: Thunderbird 2.0.0.19 (X11/20081209)

Hi,

I found a message which corresponds exactly to my problem : http://osdir.com/ml/gnu.libtool.general/2004-02/msg00093.html

Unfortunately nobody ever answered this question :)

My problem appears when building a shared library using, amongst others, static libraries. It generates something like : 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':
/data1/mysqldev/tmp-200707041150-5.0.45-27425/rpm/BUILD/mysql-5.0.45/zlib/adler32.c:61: multiple definition of `adler32' /usr/lib/mysql/libmysqlclient.a(adler32.o):/data1/mysqldev/tmp-200707041150-5.0.45-27425/rpm/BUILD/mysql-5.0.45/zlib/adler32.c:61: first defined here

How can I remove this "-Wl,--whole-archive" which is put around the static libraries ?

Thanks a lot in advance

Barth

--
Barthélémy von Haller
address@hidden
CERN PH-AID (ALICE DAQ)





reply via email to

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