X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fliblustre%2Fgenlib.sh;h=0694d624ffee664106a2e740f8cf43aa3e77d516;hb=4b02a71242504c1aa51fa5bca87721031bf670ae;hp=2c644d56d09f660ef1b555526ece62cf12929f2a;hpb=528e3dad852cf5520f87599776c0a67c42bec86a;p=fs%2Flustre-release.git diff --git a/lustre/liblustre/genlib.sh b/lustre/liblustre/genlib.sh index 2c644d5..0694d62 100755 --- a/lustre/liblustre/genlib.sh +++ b/lustre/liblustre/genlib.sh @@ -11,15 +11,13 @@ set -e # FIXME: How to do this cleanly use makefile? # -AR=/usr/bin/ar # see http://osdir.com/ml/gmane.comp.gnu.binutils.bugs/2006-01/msg00016.php ppc64_CPU=`uname -p` if [ "x${ppc64_CPU}" = "xppc64" ]; then - LD="gcc -m64" + LD="$CC -m64" else - LD="gcc" + LD=$CC fi -RANLIB=/usr/bin/ranlib CWD=`pwd` @@ -27,9 +25,8 @@ SYSIO=$1 LIBS=$2 LND_LIBS=$3 PTHREAD_LIBS=$4 -QUOTA_LIBS=$5 -CAP_LIBS=$6 -ZLIB=$7 +CAP_LIBS=$5 +ZLIB=$6 if [ ! -f $SYSIO/lib/libsysio.a ]; then echo "ERROR: $SYSIO/lib/libsysio.a dosen't exist" @@ -85,15 +82,8 @@ build_obj_list ../../libcfs/libcfs libcfsutil.a if $(echo "$LND_LIBS" | grep "socklnd" >/dev/null) ; then build_obj_list ../../lnet/ulnds/socklnd libsocklnd.a fi -if $(echo "$LND_LIBS" | grep "ptllnd" >/dev/null) ; then - build_obj_list ../../lnet/ulnds/ptllnd libptllnd.a -fi build_obj_list ../../lnet/lnet liblnet.a -if [ "x$QUOTA_LIBS" != "x" ]; then - build_obj_list ../quota libquota.a -fi - # create static lib lsupport rm -f $CWD/liblsupport.a $AR -cru $CWD/liblsupport.a $ALL_OBJS @@ -101,7 +91,7 @@ $RANLIB $CWD/liblsupport.a # if libsysio is already in our LIBS we don't need to link against it here if $(echo "$LIBS" | grep -v -- "-lsysio" >/dev/null) ; then - build_sysio_obj_list $SYSIO/lib/libsysio.a + build_sysio_obj_list $SYSIO/lib/libsysio.a fi # create static lib lustre @@ -113,9 +103,14 @@ $RANLIB $CWD/liblustre.a rm -f $CWD/liblustre.so OS=`uname` if test x$OS = xAIX; then -$LD -shared -o $CWD/liblustre.so $ALL_OBJS -lpthread -Xlinker -bnoipath ../../libsyscall.so + $LD $LDFLAGS -shared -o $CWD/liblustre.so $ALL_OBJS -lpthread -Xlinker -bnoipath ../../libsyscall.so else -$LD -shared -nostdlib -o $CWD/liblustre.so $ALL_OBJS $CAP_LIBS $PTHREAD_LIBS $ZLIB +# using -nostdlib on Ubuntu causes errors such as: +#./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 fi rm -rf $sysio_tmp