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

Re: A plan to get rid of unnecessary package dependencies



Hi Christian,

(Sorry if you get this twice, I don't know whether you subscribe to
debian-devel.)

Christian Aichinger wrote:
> As Steve Langasek detailed in his d-d-a mail[1], unnecessary
> dependencies cause lots of problems, as they make transitions
> bigger then they need to be.
> 
> The root cause are unnecessary libraries on the linker commandline,
> which get stored in the resulting binary and which dpkg-shlibdeps
> happily turns into inter-package dependencies.
> 
> Thus the goal is to eliminate those unnecessary linker arguments.
> 
> As a start, I've written a script that searches for unnecessary
> dependencies and reports them. Results are available here:
> http://rerun.lefant.net/checklib
[snip]

Thank you for this very cool effort!  Might we see checklib packaged for
Debian soon?

(I was going to ask about source code, but then I noticed the link to
here <URL:http://greek0.net/div/checklib.tar.gz> at the bottom of the
checklib web page.  Reposting it for anyone else who might not have
noticed it.)

One thing I noticed is that there are a lot of "problems" (in your
terminology) caused by unneeded dependencies on libgcc1
(/lib/libgcc_s.so.1).  From my quick investigation, it appears that the
C++ and Fortran compilers (g++, g77, gfortran) introduce this dependency
automatically to programs linked with them.  However, if gcc is instead
used in the linking step, no such dependency is created (at least on
amd64 where I'm testing).

That is, programs compiled like this have libgcc_s.so.1 NEEDED:

g++ foo.cc
g77 foo.F
gfortran foo.F

but if they are compiled to object code and then linked with plain
vanilla gcc, like this, they don't:

g++ -c foo.cc -o foo.o && gcc foo.o -lstdc++
g77 -c foo.F -o foo.o && gcc foo.o -lg2c -lfrtbegin
gfortran -c foo.F -o foo.o && gcc foo.o -lgfortran -lgfortranbegin

[CC'ed to debian-gcc to see if someone there can explain why this happens.]

Even though you are technically correct that libgcc1 is an unneeded
dependency, it may be hard for anyone (except maybe the gcc maintainers)
to do anything to fix this; could you have an option for libcheck to
ignore this library?  I suspect if this was done, the proportion of
"problems" in your pie chart would shrink a fair bit.

best regards,

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



Reply to: