On 09/18/10 09:49 PM, François Bissey wrote:
I was reading something quite interesting here.


http://blogs.sun.com/rie/entry/tt_dependencies_tt_define_what

It is written with Solaris in mind, but basically says that linking to
unnecessary libraries is is a way to slow down code. So I decided to use
the method it suggests, and see what items in Sage link to things they
don't need to. The list below is the binaries in local/bin. If it says
"unused" after them, it means there's a library linked that is not used:

Yes that blog post about LD_LIBRARY_PATH. On Gentoo we use -Wl,--as-needed
and it is default now. So all libraries that are not directly used by the
program/libraries are dropped at link time.

The script should also work on linux, we were talking about that with
Christopher a few weeks ago and we were using the same ldd options to work out
if there was any sage packages that didn't respect LDFLAGS (and therefore drop
-Wl,--as-needed). I am not sure that we have 100% coverage of every single
spkg but most of them do apply LDFLAGS now and aren't over-linked.

Francois

Of course the script I posted


#!/bin/sh
for i in `ls`
do
  if [ "x`file $i | grep 32-bit `" != x ] ; then
    echo $i
    ldd -u -r $i | grep unused
  fi
done

would only work for 32-bit binaries. You might need to change what one greps for, depending on what your system is. As long as you find something that avoids shell scripts.

BTW, although ECL is the worst offender in the current version with 3 unused libraries, there's only one in the latest git version.

I have reported this to the ECL list, and created a trac ticket for it.

http://trac.sagemath.org/sage_trac/ticket/9943

Note that it's a high priority item, but it would be good if this could be fixed upstream. It should be possible to determine what libraries need to be linked in the configure script.

Dave

--
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to