From: Thomas Stibor Date: Mon, 9 Jun 2014 14:30:14 +0000 (-0400) Subject: LU-3382 build: clean unused link dependencies X-Git-Tag: 2.6.0-RC1~103 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;ds=sidebyside;h=9d72ec94b56590ad5da7003e93dd268d81fc8d14;p=fs%2Flustre-release.git LU-3382 build: clean unused link dependencies Compiled executable Lustre files such as: lst, lstclient, loadgen, lustre_rsync, lctl, lfs, debugctl and ptlctl are linked against libtinfo.so.5 and libncurses.so.5, however none of the library's symbols are used. Same issue with multiop which is linked against librt.so.1, however uses none of the library's symbols, and liblustre.so which is linked against libz.so.1 and uses none of the library's symbols as well. Signed-off-by: Thomas Stibor Signed-off-by: James Simmons Change-Id: I861878ca93dc0a07e2d4d718870a960eb86974a9 Reviewed-on: http://review.whamcloud.com/6427 Tested-by: Jenkins Reviewed-by: Dmitry Eremin Tested-by: Maloo Reviewed-by: Andreas Dilger --- diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 index 0456002..7d6c971 100644 --- a/lnet/autoconf/lustre-lnet.m4 +++ b/lnet/autoconf/lustre-lnet.m4 @@ -625,13 +625,10 @@ AC_MSG_RESULT([$enable_readline]) LIBREADLINE="" AS_IF([test "x$enable_readline" = xyes], [ - LIBS_save="$LIBS" - LIBS="-lncurses $LIBS" AC_CHECK_LIB([readline], [readline], [ - LIBREADLINE="-lreadline -lncurses" + LIBREADLINE="-lreadline" AC_DEFINE(HAVE_LIBREADLINE, 1, [readline library is available])]) - LIBS="$LIBS_save" ]) AC_SUBST(LIBREADLINE) diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index ccafd38..ac1696e 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -1802,26 +1802,6 @@ AC_CHECK_HEADERS([linux/random.h], [], [], # utils/llverfs.c AC_CHECK_HEADERS([ext2fs/ext2fs.h]) -# check for -lz support -ZLIB="" -AC_CHECK_LIB([z], [adler32], - [AC_CHECK_HEADERS([zlib.h], [ - ZLIB="-lz" - AC_DEFINE([HAVE_ADLER], 1, - [support alder32 checksum type]) - ], [ - AC_MSG_WARN([ - -No zlib-devel package found, unable to use adler32 checksum -]) -])], [ - AC_MSG_WARN([ - -No zlib package found, unable to use adler32 checksum -]) -]) -AC_SUBST(ZLIB) - SELINUX="" AC_CHECK_LIB([selinux], [is_selinux_enabled], [AC_CHECK_HEADERS([selinux.h], diff --git a/lustre/liblustre/Makefile.am b/lustre/liblustre/Makefile.am index 7164155..6473813 100644 --- a/lustre/liblustre/Makefile.am +++ b/lustre/liblustre/Makefile.am @@ -63,7 +63,7 @@ export AR export RANLIB liblustre.a : $(LUSTRE_LIBS) $(LND_LIBS) $(LNET_LIBS) $(SYSIO_LIBS) - sh $(srcdir)/genlib.sh "$(SYSIO)" "$(LIBS)" "$(LND_LIBS)" "$(PTHREAD_LIBS)" "$(CAP_LIBS)" "$(ZLIB)" + sh $(srcdir)/genlib.sh "$(SYSIO)" "$(LIBS)" "$(LND_LIBS)" "$(PTHREAD_LIBS)" "$(CAP_LIBS)" EXTRA_DIST = genlib.sh diff --git a/lustre/liblustre/genlib.sh b/lustre/liblustre/genlib.sh index 023d630..a80ebeb 100755 --- a/lustre/liblustre/genlib.sh +++ b/lustre/liblustre/genlib.sh @@ -26,7 +26,6 @@ LIBS=$2 LND_LIBS=$3 PTHREAD_LIBS=$4 CAP_LIBS=$5 -ZLIB=$6 if [ ! -f $SYSIO/lib/libsysio.a ]; then echo "ERROR: $SYSIO/lib/libsysio.a dosen't exist" @@ -108,8 +107,8 @@ else #./llite_lib.o: In function `liblustre_process_log': #/home/brian/rpm/BUILD/lustre-1.8.2.50/lustre/liblustre/llite_lib.c:234: undefined reference to `__stack_chk_fail_local' # due to the use of SSP -#$LD -shared -nostdlib -o $CWD/liblustre.so $ALL_OBJS $CAP_LIBS $PTHREAD_LIBS $ZLIB - $LD $LDFLAGS -shared -o $CWD/liblustre.so $ALL_OBJS $CAP_LIBS $PTHREAD_LIBS $ZLIB +#$LD -shared -nostdlib -o $CWD/liblustre.so $ALL_OBJS $CAP_LIBS $PTHREAD_LIBS + $LD $LDFLAGS -shared -o $CWD/liblustre.so $ALL_OBJS $CAP_LIBS $PTHREAD_LIBS fi rm -rf $sysio_tmp diff --git a/lustre/liblustre/tests/Makefile.am b/lustre/liblustre/tests/Makefile.am index 73b9667..c6c7e27 100644 --- a/lustre/liblustre/tests/Makefile.am +++ b/lustre/liblustre/tests/Makefile.am @@ -4,7 +4,7 @@ AM_CPPFLAGS = -I$(SYSIO)/include -I/opt/lam/include $(LLCPPFLAGS) -I$(top_srcdir AM_CFLAGS = $(LLCFLAGS) AM_LIBS = $(LIBEFENCE) $(LIBREADLINE) -LLIB_EXEC = $(top_builddir)/lustre/utils/liblustreapi.a $(top_builddir)/lustre/liblustre/liblustre.a $(CAP_LIBS) $(PTHREAD_LIBS) $(ZLIB) +LLIB_EXEC = $(top_builddir)/lustre/utils/liblustreapi.a $(top_builddir)/lustre/liblustre/liblustre.a $(CAP_LIBS) $(PTHREAD_LIBS) if LIBLUSTRE noinst_LIBRARIES = libtestcommon.a diff --git a/lustre/liblustre/tests/mpi/Makefile.am b/lustre/liblustre/tests/mpi/Makefile.am index c9fb909..f354e9f 100644 --- a/lustre/liblustre/tests/mpi/Makefile.am +++ b/lustre/liblustre/tests/mpi/Makefile.am @@ -3,7 +3,7 @@ AM_CPPFLAGS = -I$(SYSIO)/include $(LLCPPFLAGS) -I$(top_srcdir)/lnet/ulnds AM_CFLAGS = $(LLCFLAGS) -LLIB_EXEC = $(top_builddir)/lustre/utils/liblustreapi.a $(top_builddir)/lustre/liblustre/liblustre.a $(CAP_LIBS) $(PTHREAD_LIBS) $(ZLIB) +LLIB_EXEC = $(top_builddir)/lustre/utils/liblustreapi.a $(top_builddir)/lustre/liblustre/liblustre.a $(CAP_LIBS) $(PTHREAD_LIBS) CC = @MPICC_WRAPPER@ diff --git a/lustre/tests/Makefile.am b/lustre/tests/Makefile.am index 6d730d5..fb1154d 100644 --- a/lustre/tests/Makefile.am +++ b/lustre/tests/Makefile.am @@ -86,7 +86,7 @@ endif # TESTS mmap_sanity_SOURCES= mmap_sanity.c LIBLUSTREAPI = $(top_builddir)/lustre/utils/liblustreapi.a -multiop_LDADD=$(LIBLUSTREAPI) -lrt $(PTHREAD_LIBS) $(LIBCFS) +multiop_LDADD=$(LIBLUSTREAPI) $(PTHREAD_LIBS) $(LIBCFS) it_test_LDADD=$(LIBCFS) rwv_LDADD=$(LIBCFS)