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

Re: dpkg-shlibdeps warning about librt.so.1 in ocamlopt binaries



Le 23/05/2012 23:55, Eric Cooper a écrit :
>     dpkg-shlibdeps: warning: package could avoid a useless dependency if
>     debian/approx/usr/sbin/approx-gc debian/approx/usr/sbin/approx-import
>     debian/approx/usr/sbin/approx were not linked against librt.so.1 (they
>     use none of the library's symbols)
> [...]

We get a lot of these warnings with OCaml packages. I see two possible
reasons:

 - When linking, ocamlc/ocamlopt use -lfoo options that come from
   *.{cma,cmxa} files, and there is no granularity there. For example,
   if foo.cma contains a module Foo that needs -lfoo, and Bar that needs
   -lbar, the resulting executable will be linked with -lfoo -lbar even
   if Bar is unused (and not linked). There is no way for the compiler
   to know that -lbar is useless, and we don't want to put that kind of
   decision in the hands of users. In this case, I would suggest as a
   fix to split foo.cma, but this could be very disrupting (especially
   is findlib is not used).

 - The bytecode interpreter (ocamlrun) uses dlopen() and dlsym() to
   access C functions, and this way of doing things is not supported by
   dpkg-shlibdeps.

I'm not sure of either of those, and investigating further has been on
my TODO-list for a very long time... but I simply ignore these warnings
for the time being.


Cheers,

-- 
Stéphane


Reply to: