523 lines
18 KiB
HTML
523 lines
18 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of dpkg-shlibdeps</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>dpkg-shlibdeps</H1>
|
|
Section: dpkg suite (1)<BR>Updated: 2020-03-23<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
dpkg-shlibdeps - generate shared library substvar dependencies
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<B>dpkg-shlibdeps</B>
|
|
|
|
[<I>option</I>...] [<I></I><B>-e</B>]<I>executable</I> [<I>option</I>...]
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<B>dpkg-shlibdeps</B>
|
|
|
|
calculates shared library dependencies for executables named in its
|
|
arguments. The dependencies are added to the substitution
|
|
variables file
|
|
<B>debian/substvars</B>
|
|
|
|
as variable names
|
|
<B>shlibs:</B><I>dependency-field</I>
|
|
|
|
where
|
|
<I>dependency-field</I>
|
|
|
|
is a dependency field name. Any other variables starting with
|
|
<B>shlibs:</B>
|
|
|
|
are removed from the file.
|
|
<P>
|
|
|
|
<B>dpkg-shlibdeps</B>
|
|
|
|
has two possible sources of information to generate dependency
|
|
information. Either
|
|
<I>symbols</I>
|
|
|
|
files or
|
|
<I>shlibs</I>
|
|
|
|
files. For each binary that
|
|
<B>dpkg-shlibdeps</B>
|
|
|
|
analyzes, it finds out the list of libraries that it's linked with.
|
|
Then, for each library, it looks up either the
|
|
<I>symbols</I>
|
|
|
|
file, or the
|
|
<I>shlibs</I>
|
|
|
|
file (if the former doesn't exist or if debian/shlibs.local contains
|
|
the relevant dependency). Both files are supposed to be provided
|
|
by the library package and should thus be available as
|
|
/var/lib/dpkg/info/<I>package</I>.<I>symbols</I>
|
|
or /var/lib/dpkg/info/<I>package</I>.<I>shlibs</I>. The package name is
|
|
identified in two steps: find the library file on the system (looking in
|
|
the same directories that <B>ld.so</B> would use), then use
|
|
<B>dpkg -S </B><I>library-file</I>
|
|
|
|
to lookup the package providing the library.
|
|
<A NAME="lbAE"> </A>
|
|
<H3>Symbols files</H3>
|
|
|
|
Symbols files contain finer-grained dependency information by providing
|
|
the minimum dependency for each symbol that the library exports. The
|
|
script tries to find a symbols file associated to a library package
|
|
in the following places (first match is used):
|
|
<DL COMPACT>
|
|
<DT id="1">debian/*/DEBIAN/symbols<DD>
|
|
Shared library information generated by the current build process that also invoked
|
|
<B>dpkg-shlibdeps</B>.
|
|
|
|
They are generated by
|
|
<B><A HREF="/cgi-bin/man/man2html?1+dpkg-gensymbols">dpkg-gensymbols</A></B>(1).
|
|
|
|
They are only used if the library is found in a package's build tree. The
|
|
symbols file in that build tree takes precedence over symbols files from
|
|
other binary packages.
|
|
<DT id="2">/etc/dpkg/symbols/<I>package</I>.symbols.<I>arch</I><DD>
|
|
<DT id="3">/etc/dpkg/symbols/<I>package</I>.symbols<DD>
|
|
Per-system overriding shared library dependency information.
|
|
<I>arch</I> is the architecture of the current system (obtained by
|
|
<B>dpkg-architecture -qDEB_HOST_ARCH</B>).
|
|
|
|
<DT id="4">Output from "<B>dpkg-query --control-path</B> <I>package</I> symbols"<DD>
|
|
Package-provided shared library dependency information.
|
|
Unless overridden by <B>--admindir</B>, those files are located in
|
|
/var/lib/dpkg.
|
|
</DL>
|
|
<P>
|
|
|
|
While scanning the symbols used by all binaries,
|
|
<B>dpkg-shlibdeps</B>
|
|
|
|
remembers the (biggest) minimal version needed for each library. At the end
|
|
of the process, it is able to write out the minimal dependency for every
|
|
library used (provided that the information of the <I>symbols</I> files are
|
|
accurate).
|
|
<P>
|
|
|
|
As a safe-guard measure, a symbols file can provide a
|
|
<B>Build-Depends-Package</B> meta-information field and
|
|
<B>dpkg-shlibdeps</B>
|
|
|
|
will extract the minimal version required by the corresponding package in
|
|
the <B>Build-Depends</B> field and use this version if it's higher than the
|
|
minimal version computed by scanning symbols.
|
|
<A NAME="lbAF"> </A>
|
|
<H3>Shlibs files</H3>
|
|
|
|
Shlibs files associate directly a library to a dependency (without looking
|
|
at the symbols). It's thus often stronger than really needed but very safe
|
|
and easy to handle.
|
|
<P>
|
|
|
|
The dependencies for a library are looked up in several places. The first
|
|
file providing information for the library of interest is used:
|
|
<DL COMPACT>
|
|
<DT id="5">debian/shlibs.local<DD>
|
|
Package-local overriding shared library dependency information.
|
|
<DT id="6">/etc/dpkg/shlibs.override<DD>
|
|
Per-system overriding shared library dependency information.
|
|
<DT id="7">debian/*/DEBIAN/shlibs<DD>
|
|
Shared library information generated by the current build process that also invoked
|
|
<B>dpkg-shlibdeps</B>.
|
|
|
|
They are only used if the library is found in a package's build tree. The
|
|
shlibs file in that build tree takes precedence over shlibs files from
|
|
other binary packages.
|
|
<DT id="8">Output from "<B>dpkg-query --control-path</B> <I>package</I> shlibs"<DD>
|
|
Package-provided shared library dependency information.
|
|
Unless overridden by <B>--admindir</B>, those files are located in
|
|
/var/lib/dpkg.
|
|
<DT id="9">/etc/dpkg/shlibs.default<DD>
|
|
Per-system default shared library dependency information.
|
|
</DL>
|
|
<P>
|
|
|
|
The extracted dependencies are then directly used (except if they are
|
|
filtered out because they have been identified as duplicate, or as weaker
|
|
than another dependency).
|
|
<A NAME="lbAG"> </A>
|
|
<H2>OPTIONS</H2>
|
|
|
|
<B>dpkg-shlibdeps</B>
|
|
|
|
interprets non-option arguments as executable names, just as if they'd
|
|
been supplied as
|
|
<B>-e</B><I>executable</I>.
|
|
|
|
<DL COMPACT>
|
|
<DT id="10"><B>-e</B><I>executable</I>
|
|
|
|
<DD>
|
|
Include dependencies appropriate for the shared libraries required by
|
|
<I>executable</I>.
|
|
|
|
This option can be used multiple times.
|
|
<DT id="11"><B>-l</B><I>directory</I>
|
|
|
|
<DD>
|
|
Prepend
|
|
<I>directory</I>
|
|
|
|
to the list of directories to search for private shared libraries
|
|
(since dpkg 1.17.0). This option can be used multiple times.
|
|
<P>
|
|
Note: Use this option instead of setting <B>LD_LIBRARY_PATH</B>,
|
|
as that environment variable is used to control the run-time linker
|
|
and abusing it to set the shared library paths at build-time can be
|
|
problematic when cross-compiling for example.
|
|
<DT id="12"><B>-d</B><I>dependency-field</I>
|
|
|
|
<DD>
|
|
Add dependencies to be added to the control file dependency field
|
|
<I>dependency-field</I>.
|
|
|
|
(The dependencies for this field are placed in the variable
|
|
<B>shlibs:</B><I>dependency-field</I>.)
|
|
|
|
<P>
|
|
The
|
|
<B>-d</B><I>dependency-field</I>
|
|
|
|
option takes effect for all executables after the option, until the
|
|
next
|
|
<B>-d</B><I>dependency-field</I>.
|
|
|
|
The default
|
|
<I>dependency-field</I>
|
|
|
|
is
|
|
<B>Depends</B>.
|
|
|
|
<P>
|
|
If the same dependency entry (or set of alternatives) appears in more
|
|
than one of the recognized dependency field names
|
|
<B>Pre-Depends</B>, <B>Depends</B>, <B>Recommends</B>, <B>Enhances</B> or <B>Suggests</B>
|
|
|
|
then
|
|
<B>dpkg-shlibdeps</B>
|
|
|
|
will automatically remove the dependency from all fields except the
|
|
one representing the most important dependencies.
|
|
<DT id="13"><B>-p</B><I>varname-prefix</I>
|
|
|
|
<DD>
|
|
Start substitution variables with
|
|
<I>varname-prefix</I><B>:</B>
|
|
|
|
instead of
|
|
<B>shlibs:</B>.
|
|
|
|
Likewise, any existing substitution variables starting with
|
|
<I>varname-prefix</I><B>:</B>
|
|
|
|
(rather than
|
|
<B>shlibs:</B>)
|
|
|
|
are removed from the substitution variables file.
|
|
<DT id="14"><B>-O</B>[<I>filename</I>]
|
|
|
|
<DD>
|
|
Print substitution variable settings to standard output (or <I>filename</I>
|
|
if specified, since dpkg 1.17.2), rather than being added to the
|
|
substitution variables file
|
|
(<B>debian/substvars</B>
|
|
|
|
by default).
|
|
<DT id="15"><B>-t</B><I>type</I>
|
|
|
|
<DD>
|
|
Prefer shared library dependency information tagged for the given
|
|
package type. If no tagged information is available, falls back to untagged
|
|
information. The default package type is <B>deb</B>. Shared library dependency
|
|
information is tagged for a given type by prefixing it with the name of the
|
|
type, a colon, and whitespace.
|
|
<DT id="16"><B>-L</B><I>local-shlibs-file</I>
|
|
|
|
<DD>
|
|
Read overriding shared library dependency information from
|
|
<I>local-shlibs-file</I>
|
|
|
|
instead of
|
|
<B>debian/shlibs.local</B>.
|
|
|
|
<DT id="17"><B>-T</B><I>substvars-file</I>
|
|
|
|
<DD>
|
|
Write substitution variables in
|
|
<I>substvars-file</I>;
|
|
|
|
the default is
|
|
<B>debian/substvars</B>.
|
|
|
|
<DT id="18"><B>-v</B>
|
|
|
|
<DD>
|
|
Enable verbose mode (since dpkg 1.14.8).
|
|
Numerous messages are displayed to explain what
|
|
<B>dpkg-shlibdeps</B>
|
|
|
|
does.
|
|
<DT id="19"><B>-x</B><I>package</I>
|
|
|
|
<DD>
|
|
Exclude the package from the generated dependencies (since dpkg 1.14.8).
|
|
This is useful to
|
|
avoid self-dependencies for packages which provide ELF binaries
|
|
(executables or library plugins) using a library contained in the same
|
|
package. This option can be used multiple times to exclude several
|
|
packages.
|
|
<DT id="20"><B>-S</B><I>package-build-dir</I>
|
|
|
|
<DD>
|
|
Look into <I>package-build-dir</I> first when trying to find a library
|
|
(since dpkg 1.14.15).
|
|
This is
|
|
useful when the source package builds multiple flavors of the same library
|
|
and you want to ensure that you get the dependency from a given binary
|
|
package. You can use this option multiple times: directories will be
|
|
tried in the same order before directories of other binary packages.
|
|
<DT id="21"><B>-I</B><I>package-build-dir</I>
|
|
|
|
<DD>
|
|
Ignore <I>package-build-dir</I> when looking for shlibs, symbols, and shared
|
|
library files (since dpkg 1.18.5).
|
|
You can use this option multiple times.
|
|
<DT id="22"><B>--ignore-missing-info</B>
|
|
|
|
<DD>
|
|
Do not fail if dependency information can't be found for a shared library
|
|
(since dpkg 1.14.8).
|
|
Usage of this option is discouraged, all libraries should provide
|
|
dependency information (either with shlibs files, or with symbols files)
|
|
even if they are not yet used by other packages.
|
|
<DT id="23"><B>--warnings=</B><I>value</I>
|
|
|
|
<DD>
|
|
<I>value</I> is a bit field defining the set of warnings that
|
|
can be emitted by <B>dpkg-shlibdeps</B> (since dpkg 1.14.17).
|
|
Bit 0 (value=1) enables the warning "symbol <I>sym</I> used by <I>binary</I>
|
|
found in none of the libraries", bit 1 (value=2) enables the warning
|
|
"package could avoid a useless dependency" and bit 2 (value=4) enables
|
|
the warning "<I>binary</I> should not be linked against <I>library</I>".
|
|
The default <I>value</I> is 3: the first two warnings are active by
|
|
default, the last one is not. Set <I>value</I> to 7 if you want all
|
|
warnings to be active.
|
|
<DT id="24"><B>--admindir=</B><I>dir</I>
|
|
|
|
<DD>
|
|
Change the location of the <B>dpkg</B> database (since dpkg 1.14.0).
|
|
The default location is <I>/var/lib/dpkg</I>.
|
|
<DT id="25"><B>-?</B>, <B>--help</B>
|
|
|
|
<DD>
|
|
Show the usage message and exit.
|
|
<DT id="26"><B>--version</B>
|
|
|
|
<DD>
|
|
Show the version and exit.
|
|
</DL>
|
|
<A NAME="lbAH"> </A>
|
|
<H2>ENVIRONMENT</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="27"><B>DPKG_COLORS</B>
|
|
|
|
<DD>
|
|
Sets the color mode (since dpkg 1.18.5).
|
|
The currently accepted values are: <B>auto</B> (default), <B>always</B> and
|
|
<B>never</B>.
|
|
<DT id="28"><B>DPKG_NLS</B>
|
|
|
|
<DD>
|
|
If set, it will be used to decide whether to activate Native Language Support,
|
|
also known as internationalization (or i18n) support (since dpkg 1.19.0).
|
|
The accepted values are: <B>0</B> and <B>1</B> (default).
|
|
</DL>
|
|
<A NAME="lbAI"> </A>
|
|
<H2>DIAGNOSTICS</H2>
|
|
|
|
<A NAME="lbAJ"> </A>
|
|
<H3>Warnings</H3>
|
|
|
|
Since
|
|
<B>dpkg-shlibdeps</B>
|
|
|
|
analyzes the set of symbols used by each binary of the generated package,
|
|
it is able to emit warnings in several cases. They inform you of things
|
|
that can be improved in the package. In most cases, those improvements
|
|
concern the upstream sources directly. By order of decreasing importance,
|
|
here are the various warnings that you can encounter:
|
|
<DL COMPACT>
|
|
<DT id="29"><B>symbol</B><I> sym</I><B> used by </B><I>binary</I><B> found in none of the libraries.</B>
|
|
|
|
<DD>
|
|
The indicated symbol has not been found in the libraries linked with the
|
|
binary. The <I>binary</I> is most likely a library and it needs to be linked
|
|
with an additional library during the build process (option
|
|
<B>-l</B><I>library</I> of the linker).
|
|
<DT id="30"><I>binary</I><B> contains an unresolvable reference to symbol </B><I>sym</I><B>: it's probably a plugin</B>
|
|
|
|
<DD>
|
|
The indicated symbol has not been found in the libraries linked with the
|
|
binary. The <I>binary</I> is most likely a plugin and the symbol is
|
|
probably provided by the program that loads this plugin. In theory a
|
|
plugin doesn't have any SONAME but this binary does have one and as such
|
|
it could not be clearly identified as such. However the fact that the
|
|
binary is stored in a non-public directory is a strong indication
|
|
that's it's not a normal shared library. If the binary is really a
|
|
plugin, then disregard this warning. But there's always the possibility
|
|
that it's a real library and that programs linking to it are using an
|
|
RPATH so that the dynamic loader finds it. In that case, the library is
|
|
broken and needs to be fixed.
|
|
<DT id="31"><B>package could avoid a useless dependency if </B><I>binary</I><B> was not linked against </B><I>library</I><B> (it uses none of the library's symbols)</B>
|
|
|
|
<DD>
|
|
None of the <I>binaries</I> that are linked with library use any of the
|
|
symbols provided by the library. By fixing all the binaries, you would avoid
|
|
the dependency associated to this library (unless the same dependency is
|
|
also generated by another library that is really used).
|
|
<DT id="32"><B>package could avoid a useless dependency if </B><I>binaries</I><B> were not linked against </B><I>library</I><B> (they use none of the library's symbols)</B>
|
|
|
|
<DD>
|
|
Exactly the same as the above warning, but for multiple binaries.
|
|
<DT id="33"><I>binary</I><B> should not be linked against </B><I>library</I><B> (it uses none of the library's symbols)</B>
|
|
|
|
<DD>
|
|
The <I>binary</I> is linked to a library that it doesn't need. It's not a
|
|
problem but some small performance improvements in binary load time can be
|
|
obtained by not linking this library to this binary. This warning checks
|
|
the same information as the previous one but does it for each binary
|
|
instead of doing the check globally on all binaries analyzed.
|
|
</DL>
|
|
<A NAME="lbAK"> </A>
|
|
<H3>Errors</H3>
|
|
|
|
<B>dpkg-shlibdeps</B>
|
|
|
|
will fail if it can't find a public library used by a binary or if this
|
|
library has no associated dependency information (either shlibs file or
|
|
symbols file). A public library has a SONAME and is versioned
|
|
(libsomething.so.<I>X</I>). A private library (like a plugin) should not
|
|
have a SONAME and doesn't need to be versioned.
|
|
<DL COMPACT>
|
|
<DT id="34"><B>couldn't find library </B><I>library-soname</I><B> needed by </B><I>binary</I><B> (its RPATH is '</B><I>rpath</I><B>')</B>
|
|
|
|
<DD>
|
|
The <I>binary</I> uses a library called <I>library-soname</I> but
|
|
<B>dpkg-shlibdeps</B>
|
|
|
|
has been unable to find the library.
|
|
<B>dpkg-shlibdeps</B>
|
|
|
|
creates a list of directories to check as following: directories listed in
|
|
the RPATH of the binary, directories added by the <B>-l</B> option, directories
|
|
listed in the <B>LD_LIBRARY_PATH</B> environment variable, cross multiarch
|
|
directories (ex. /lib/arm64-linux-gnu, /usr/lib/arm64-linux-gnu), standard
|
|
public directories (/lib, /usr/lib), directories listed in /etc/ld.so.conf,
|
|
and obsolete multilib directories (/lib32, /usr/lib32, /lib64, /usr/lib64).
|
|
Then it checks those directories in the package's build tree
|
|
of the binary being analyzed, in the packages' build trees indicated with
|
|
the <B>-S</B> command-line option, in other packages' build trees that contains
|
|
a DEBIAN/shlibs or DEBIAN/symbols file and finally in the root directory.
|
|
If the library is not found in any of those directories, then you get this
|
|
error.
|
|
<P>
|
|
If the library not found is in a private directory of the same package,
|
|
then you want to add the directory with <B>-l</B>. If it's in another
|
|
binary package being built, you want to make sure that the shlibs/symbols
|
|
file of this package is already created and that <B>-l</B>
|
|
contains the appropriate directory if it also is in a private directory.
|
|
<DT id="35"><B>no dependency information found for </B><I>library-file</I><B> (used by </B><I>binary</I><B>).</B>
|
|
|
|
<DD>
|
|
The library needed by <I>binary</I> has been found by
|
|
<B>dpkg-shlibdeps</B>
|
|
|
|
in <I>library-file</I> but
|
|
<B>dpkg-shlibdeps</B>
|
|
|
|
has been unable to find any dependency information for that library. To
|
|
find out the dependency, it has tried to map the library to a Debian
|
|
package with the help of
|
|
<B>dpkg -S </B><I>library-file</I>.
|
|
|
|
Then it checked the corresponding shlibs and symbols files in
|
|
/var/lib/dpkg/info/, and in the various package's build trees
|
|
(debian/*/DEBIAN/).
|
|
<P>
|
|
This failure can be caused by a bad or missing shlibs or symbols file
|
|
in the package of the library. It might also happen if the library is
|
|
built within the same source package and if the shlibs files has not yet
|
|
been created (in which case you must fix debian/rules to create
|
|
the shlibs before calling <B>dpkg-shlibdeps</B>). Bad RPATH can also
|
|
lead to the library being found under a non-canonical name (example:
|
|
/usr/lib/openoffice.org/../lib/libssl.so.0.9.8 instead of
|
|
/usr/lib/libssl.so.0.9.8) that's not associated to any package,
|
|
<B>dpkg-shlibdeps</B>
|
|
|
|
tries to work around this by trying to fallback on a canonical name (using
|
|
<B><A HREF="/cgi-bin/man/man2html?3+realpath">realpath</A></B>(3))
|
|
|
|
but it might not always work. It's always best to clean up the RPATH
|
|
of the binary to avoid problems.
|
|
<P>
|
|
Calling
|
|
<B>dpkg-shlibdeps</B>
|
|
|
|
in verbose mode (<B>-v</B>) will provide much more information about where it
|
|
tried to find the dependency information. This might be useful if you
|
|
don't understand why it's giving you this error.
|
|
</DL>
|
|
<A NAME="lbAL"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?5+deb-shlibs">deb-shlibs</A></B>(5),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?5+deb-symbols">deb-symbols</A></B>(5),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+dpkg-gensymbols">dpkg-gensymbols</A></B>(1).
|
|
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="36"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="37"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="38"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DL>
|
|
<DT id="39"><A HREF="#lbAE">Symbols files</A><DD>
|
|
<DT id="40"><A HREF="#lbAF">Shlibs files</A><DD>
|
|
</DL>
|
|
<DT id="41"><A HREF="#lbAG">OPTIONS</A><DD>
|
|
<DT id="42"><A HREF="#lbAH">ENVIRONMENT</A><DD>
|
|
<DT id="43"><A HREF="#lbAI">DIAGNOSTICS</A><DD>
|
|
<DL>
|
|
<DT id="44"><A HREF="#lbAJ">Warnings</A><DD>
|
|
<DT id="45"><A HREF="#lbAK">Errors</A><DD>
|
|
</DL>
|
|
<DT id="46"><A HREF="#lbAL">SEE ALSO</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:11 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|