Bug #38893 mysql build is ridiculously explicit about which libraries to link
Submitted: 19 Aug 2008 14:25 Modified: 16 Jan 2014 13:54
Reporter: Daniel Fischer Email Updates:
Status: Won't fix Impact on me:
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.1, 6.0 OS:Any (Solaris 10 i386)
Assigned to: CPU Architecture:Any

[19 Aug 2008 14:25] Daniel Fischer
Libraries to link are being passed to the linker multiple times. Example line from a build log:

CC -instances=static -g -O2 -D_FORTEC_ -noex -DHAVE_RWLOCK_T -DBIG_TABLES -g -o ndb_restore restore_main.o consumer.o consumer_restore.o consumer_printer.o Restore.o NDBT_ResultRow.o NDBT_ReturnCodes.o NDBT_Table.o NDBT_Output.o  ../../../storage/ndb/src/.libs/libndbclient.a -lnsl -lrt -lsocket -lpthread -lthread -lrt -lsocket -lnsl -lpthread -lthread -lnsl -lrt -lsocket -lpthread -lthread -lrt -lsocket -lnsl -lpthread -lthread -lnsl -lrt -lsocket -lpthread -lthread -lrt -lsocket -lnsl -lpthread -lthread -lnsl -lrt -lsocket -lpthread -lthread -lrt -lsocket -lnsl -lpthread -lthread -lnsl -lrt -lsocket -lpthread -lthread -lrt -lsocket -lnsl -lpthread -lthread -lnsl -lrt -lsocket -lpthread -lthread -lrt -lsocket -lnsl -lpthread -lthread -lnsl -lrt -lsocket -lpthread -lthread -lrt -lsocket -lnsl -lpthread -lthread -lnsl -lrt -lsocket -lpthread -lthread -lrt -lsocket -lnsl -lpthread -lthread -lnsl -lrt -lsocket -lpthread -lthread -lrt -lsocket -lnsl -lpthread -lthread -lnsl -lrt -lsocket -lpthread -lthread -lrt -lsocket -lnsl -lpthread -lthread -lnsl -lrt -lsocket -lpthread -lthread -lrt -lsocket -lnsl -lpthread -lthread -lnsl -lrt -lsocket -lpthread -lthread -lrt -lsocket -lnsl -lpthread -lthread -lnsl -lrt -lsocket -lpthread -lthread -lrt -lsocket -lnsl -lpthread -lthread -lnsl -lrt -lsocket -lpthread -lthread -lrt -lsocket -lnsl -lpthread -lthread -lnsl -lrt -lsocket -lpthread -lthread -lrt -lsocket -lnsl -lpthread -lthread -lnsl -lrt -lsocket -lpthread -lthread -lrt -lsocket -lnsl -lpthread -lthread -lnsl -lrt -lsocket -lpthread -lthread -lrt -lsocket -lnsl -lpthread -lthread -lnsl -lrt -lsocket -lpthread -lthread -lrt -lsocket -lnsl -lpthread -lthread -lnsl -lrt -lsocket -lpthread -lthread -lrt -lsocket -lnsl -lpthread -lthread -lnsl -lrt -lsocket -lpthread -lthread -lrt -lsocket -lnsl -lpthread -lthread ../../../dbug/libdbug.a ../../../mysys/libmysys.a ../../../strings/libmystrings.a ../../../zlib/.libs/libzlt.a -lrt -lsocket -lnsl -lnsl -lrt -lresolv -lsocket -lpthread -lthread -lrt -lgen -lsocket -lnsl -lm -lpthread -lthread

How to repeat:
build 6.0, observe scroll
[19 Aug 2008 14:42] Sveta Smirnova
Thank you for the report.

I can not notice same behavior in my environment. Please indicate platform and how you compile MySQL.
[19 Aug 2008 14:45] Daniel Fischer
Compiler used: Sun Studio 12
Platform: Solaris 10 i386

+ uname -a
SunOS siv21 5.10 Generic_127128-11 i86pc i386 i86pc
+ CFLAGS='-g -O2 -Xa -xstrconst -mt -D_FORTEC_'
+ CXXFLAGS='-g -O2 -noex -mt -D_FORTEC_'
+ export CFLAGS
+ export CXXFLAGS
+ export ASFLAGS
+ export LDFLAGS
+ ./configure --enable-thread-safe-client --enable-local-infile --with-pic --with-client-ldflags=-static --with-mysqld-ldflags=-static --with-zlib-dir=bundled --without-ndb-debug --with-big-tables --with-ssl --with-readline --with-embedded-server --with-archive-storage-engine --with-blackhole-storage-engine --with-csv-storage-engine --with-example-storage-engine --with-federated-storage-engine --with-partition --with-extra-charsets=all --with-innodb --with-ndbcluster --with-libevent --with-falcon
[28 Sep 2010 18:32] Jonathan Perkin

CMake appears to fix this, at least some logs I've checked have no such repetition.

Given we're unlikely to fix this for 5.1, time to close this bug?
[16 Jan 2014 13:53] Ståle Deraas
Posted by developer:
Autotools specific.