[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Changed library interface causing FTBFS of cernlib?



On Mon, 23 Feb 2004, Kevin B. McCarty wrote:

> 1) To fix this, the only thing I should have to do is change my linker 
> flags as below, is that correct?
> 
> -L/usr/X11R6/lib -lXm -lXt -lXp -lXext -lX11 -lSM -lICE -lXpm -lnsl -lcrypt -ldl -lg2c
>                                              ^^^^^^^^^^^^^^^^
> added flags ---------------------------------------'

correction: assuming my library dependency checking script (attached) is
correct, having run it on an shlib directory filled with symlinks to 
the libs in /usr/X11R6/lib, the linkage for Lesstif programs should be:

-L/usr/X11R6/lib -lXm -lXp -lXt -lXext -lXpm -lX11 -lSM -lICE

is that right?

-- 
Kevin B. McCarty <kmccarty@princeton.edu>   Physics Department
WWW: http://www.princeton.edu/~kmccarty/    Princeton University
GPG: public key ID 4F83C751                 Princeton, NJ 08544
#!/bin/bash

# This script creates lists of all the dependencies and symbols required
# by each shared library in $CERNLEVEL/shlib and program in $CERNLEVEL/bin.
# Should be run while in the top-level cernlib-<version> source dir.

errormsg() {
	echo "Not in correct directory or cernlib not compiled with shlibs"
	exit 1
}

# remove old files
for file in `ls -1 *.txt` libdeps bindeps ; do rm -rf $file ; done
if [ ! -d shlib ] ; then errormsg ; fi

mkdir -p libdeps
[ -d bin ] && mkdir -p bindeps

# create symbol lists...

# exclude symbols found in libc and libg2c since we already know everything
# depends on those
EXCLUDE='(^[^_]_[^_]|^do_.io$|^pow_zz$|^G77|@@GLIBC)'

cd shlib
for lib in `ls -1 lib*.so` ; do
	nm -D $lib | grep ' U ' | awk '{print $2}' \
		| egrep -v "$EXCLUDE" > ../${lib%%.so}.undef.txt
	nm -D $lib | grep -v ' U ' | awk '{print $3}' > ../${lib%%.so}.def.txt
done
if [ -d "../bin" ] ; then
	cd ../bin
	for prog in `ls -1` ; do
		if [ -n "`nm $prog 2> /dev/null`" ] ; then
			nm $prog | grep ' U ' | awk '{print $2}' \
			| egrep -v "$EXCLUDE" > ../$prog.undef.txt
		fi
	done
fi
	
# create lists of symbol dependencies
cd ..
for symlist in `ls -1 *.undef.txt` ; do
	(
		for symbol in `cat $symlist` ; do
			egrep '^'$symbol'$' *.def.txt
		done
	) | tr ':.' '  ' | awk '{print $1 " " $4}' | sort \
	>> ${symlist%%.undef.txt}.symdeps.txt
done

cat *.def.txt > defined.txt

for symlist in `ls -1 *.undef.txt` ; do
	(
		for symbol in `cat $symlist` ; do
			if [ -z "`egrep -l '^'$symbol'$' defined.txt`" ] ; then
				echo $symbol
			fi
		done
	) | sort > ${symlist%%.undef.txt}.not-in-cernlib.txt
done

# delete unneeded files
rm -f defined.txt *.def.txt *.undef.txt

# create lists of file dependencies with number of dependent symbols
for file in `ls -1 *.symdeps.txt` ; do
	tempfile=${file%%.symdeps.txt}.filedeps.txt.tmp
	cat $file | awk '{ print $1 }' | sort | uniq > $tempfile
	for file2 in `cat $tempfile` ; do
		echo "$file2 `grep $file2 $file | wc -l`" >> ${tempfile%%.tmp}
	done
	rm -f $tempfile
done

# move to proper places
mv lib*.txt libdeps/
[ -d bindeps ] && mv *.txt bindeps/

exit 0

Reply to: