1dpkg-shlibdeps(1) dpkg utilities dpkg-shlibdeps(1)
2
3
4
6 dpkg-shlibdeps - generate shared library substvar dependencies
7
9 dpkg-shlibdeps [options] executable|-eexecutable [options]
10
12 dpkg-shlibdeps calculates shared library dependencies for executables
13 named in its arguments. The dependencies are added to the substitution
14 variables file debian/substvars as variable names shlibs:dependency‐
15 field where dependencyfield is a dependency field name. Any other vari‐
16 ables starting shlibs: are removed from the file.
17
18 dpkg-shlibdeps has two possible sources of information to generate
19 dependency information. Either symbols files or shlibs files. For each
20 binary that dpkg-shlibdeps analyzes, it finds out the list of libraries
21 that it's linked with. Then, for each library, it looks up either the
22 symbols file, or the shlibs file (if the former doesn't exist or if
23 debian/shlibs.local contains the relevant dependency). Both files are
24 supposed to be provided by the library package and should thus be
25 available as /var/lib/dpkg/info/package.symbols or
26 /var/lib/dpkg/info/package.shlibs. The package name is identified in
27 two steps: find the library file on the system (looking in the same
28 directories that ld.so would use), then use dpkg -S library-file to
29 lookup the package providing the library.
30
31 Symbols files
32 Symbols files contain finer-grained dependency information by providing
33 the minimum dependency for each symbol that the library exports. The
34 script tries to find a symbols file associated to a library package in
35 the following places (first match is used):
36
37 debian/*/DEBIAN/symbols
38 Shared library information generated by the current build
39 process that also invoked dpkg-shlibdeps. They are generated by
40 dpkg-gensymbols(1). They are only used if the library is found
41 in a package's build tree. The symbols file in that build tree
42 takes precedence over symbols files from other binary packages.
43
44 /etc/dpkg/symbols/package.symbols.arch
45
46 /etc/dpkg/symbols/package.symbols
47 Per-system overriding shared library dependency information.
48 arch is the architecture of the current system (obtained by
49 dpkg-architecture -qDEB_HOST_ARCH).
50
51 admindir/info/package.symbols
52 Package-provided shared library dependency information. Unless
53 overridden, admindir is /var/lib/dpkg.
54
55 While scanning the symbols used by all binaries, dpkg-shlibdeps remem‐
56 bers the (biggest) minimal version needed for each library. At the end
57 of the process, it is able to write out the minimal dependency for
58 every library used (provided that the information of the symbols files
59 are accurate).
60
61 As a safe-guard measure, a symbols file can provide a Build-Depends-
62 Package meta-information field and dpkg-shlibdeps will extract the min‐
63 imal version required by the corresponding package in the Build-Depends
64 field and use this version if it's higher than the minimal version com‐
65 puted by scanning symbols.
66
67 Shlibs files
68 Shlibs files associate directly a library to a dependency (without
69 looking at the symbols). It's thus often stronger than really needed
70 but very safe and easy to handle.
71
72 The dependencies for a library are looked up in several places. The
73 first file providing information for the library of interest is used:
74
75 debian/shlibs.local
76 Package-local overriding shared library dependency information.
77
78 /etc/dpkg/shlibs.override
79 Per-system overriding shared library dependency information.
80
81 debian/*/DEBIAN/shlibs
82 Shared library information generated by the current build
83 process that also invoked dpkg-shlibdeps. They are only used if
84 the library is found in a package's build tree. The shlibs file
85 in that build tree takes precedence over shlibs files from other
86 binary packages.
87
88 admindir/info/package.shlibs
89 Package-provided shared library dependency information. Unless
90 overridden, admindir is /var/lib/dpkg.
91
92 /etc/dpkg/shlibs.default
93 Per-system default shared library dependency information.
94
95 The extracted dependencies are then directly used (except if they are
96 filtered out because they have been identified as duplicate, or as
97 weaker than another dependency).
98
100 dpkg-shlibdeps interprets non-option arguments as executable names,
101 just as if they'd been supplied as -eexecutable.
102
103 -eexecutable
104 Include dependencies appropriate for the shared libraries
105 required by executable.
106
107 -ddependencyfield
108 Add dependencies to be added to the control file dependency
109 field dependencyfield. (The dependencies for this field are
110 placed in the variable shlibs:dependencyfield.)
111
112 The -ddependencyfield option takes effect for all executables
113 after the option, until the next -ddependencyfield. The default
114 dependencyfield is Depends.
115
116 If the same dependency entry (or set of alternatives) appears in
117 more than one of the recognised dependency field names
118 Pre-Depends, Depends, Recommends, Enhances or Suggests then
119 dpkg-shlibdeps will automatically remove the dependency from all
120 fields except the one representing the most important dependen‐
121 cies.
122
123 -pvarnameprefix
124 Start substitution variables with varnameprefix: instead of
125 shlibs:. Likewise, any existing substitution variables starting
126 with varnameprefix: (rather than shlibs:) are removed from the
127 the substitution variables file.
128
129 -O Print substitution variable settings to standard output, rather
130 than being added to the substitution variables file (debian/sub‐
131 stvars by default).
132
133 -ttype Prefer shared library dependency information tagged for the
134 given package type. If no tagged information is available, falls
135 back to untagged information. The default package type is "deb".
136 Shared library dependency information is tagged for a given type
137 by prefixing it with the name of the type, a colon, and white‐
138 space.
139
140 -Llocalshlibsfile
141 Read overriding shared library dependency information from
142 localshlibsfile instead of debian/shlibs.local.
143
144 -Tsubstvarsfile
145 Write substitution variables in substvarsfile; the default is
146 debian/substvars.
147
148 -v Enable verbose mode. Numerous messages are displayed to explain
149 what dpkg-shlibdeps does.
150
151 -xpackage
152 Exclude the package from the generated dependencies. This is
153 useful to avoid self-dependencies for packages which provide ELF
154 binaries (executables or library plugins) using a library con‐
155 tained in the same package. This option can be used multiple
156 times to exclude several packages.
157
158 -Spkgbuilddir
159 Look into pkgbuilddir first when trying to find a library. This
160 is useful when the source package builds multiple flavors of the
161 same library and you want to ensure that you get the dependency
162 from a given binary package. You can use this option multiple
163 times: directories will be tried in the same order before direc‐
164 tories of other binary packages.
165
166 --ignore-missing-info
167 Do not fail if dependency information can't be found for a
168 shared library. Usage of this option is discouraged, all
169 libraries should provide dependency information (either with
170 shlibs files, or with symbols files) even if they are not yet
171 used by other packages.
172
173 --warnings=value
174 value is a bit field defining the set of warnings that can be
175 emitted by dpkg-shlibdeps. Bit 0 (value=1) enables the warning
176 "symbol sym used by binary found in none of the libraries", bit
177 1 (value=2) enables the warning "dependency on library could be
178 avoided" and bit 2 (value=4) enables the warning "binary
179 shouldn't be linked with library". The default value is 3: the
180 first two warnings are active by default, the last one is not.
181 Set value to 7 if you want all warnings to be active.
182
183 --admindir=dir
184 Change the location of the dpkg database. The default location
185 is /var/lib/dpkg.
186
187 -h, --help
188 Show the usage message and exit.
189
190 --version
191 Show the version and exit.
192
194 Since dpkg-shlibdeps analyzes the set of symbols used by each binary of
195 the generated package, it is able to emit warnings in several cases.
196 They inform you of things that can be improved in the package. In most
197 cases, those improvements concern the upstream sources directly. By
198 order of decreasing importance, here are the various warnings that you
199 can encounter:
200
201 symbol sym used by binary found in none of the libraries.
202 The indicated symbol has not been found in the libraries linked
203 with the binary. The binary is most likely a library and it
204 needs to be linked with an additional library during the build
205 process (option -llibrary of the linker).
206
207 binary contains an unresolvable reference to symbol sym: it's probably
208 a plugin
209 The indicated symbol has not been found in the libraries linked
210 with the binary. The binary is most likely a plugin and the sym‐
211 bol is probably provided by the program that loads this plugin.
212 In theory a plugin doesn't have any SONAME but this binary does
213 have one and as such it could not be clearly identified as such.
214 However the fact that the binary is stored in a non-public
215 directory is a strong indication that's it's not a normal shared
216 library. If the binary is really a plugin, then disregard this
217 warning. But there's always the possibility that it's a real
218 library and that programs linking to it are using an RPATH so
219 that the dynamic loader finds it. In that case, the library is
220 broken and needs to be fixed.
221
222 dependency on library could be avoided if binaries were not uselessly
223 linked against it (they use none of its symbols).
224 None of the binaries that are linked with library use any of the
225 symbols provided by the library. By fixing all the binaries, you
226 would avoid the dependency associated to this library (unless
227 the same dependency is also generated by another library that is
228 really used).
229
230 binary shouldn't be linked with library (it uses none of its symbols).
231 The binary is linked to a library that it doesn't need. It's not
232 a problem but some small performance improvements in binary load
233 time can be obtained by not linking this library to this binary.
234 This warning checks the same information than the previous one
235 but does it for each binary instead of doing the check globally
236 on all binaries analyzed.
237
239 dpkg-shlibdeps will fail if it can't find a public library used by a
240 binary or if this library has no associated dependency information
241 (either shlibs file or symbols file). A public library has a SONAME and
242 is versioned (libsomething.so.X). A private library (like a plugin)
243 should not have a SONAME and doesn't need to be versioned.
244
245 couldn't find library library-soname needed by binary (its RPATH is
246 'rpath')
247 The binary uses a library called library-soname but dpkg-shlib‐
248 deps has been unable to find the library. dpkg-shlibdeps cre‐
249 ates a list of directories to check as following: directories
250 listed in the RPATH of the binary, directories listed in
251 /etc/ld.so.conf, directories listed in the LD_LIBRARY_PATH envi‐
252 ronment variable, and standard public directories (/lib,
253 /usr/lib, /lib32, /usr/lib32, /lib64, /usr/lib64). Then it
254 checks those directories in the package's build tree of the
255 binary being analyzed, in the packages's build trees indicated
256 with the -S command-line option, in other packages's build trees
257 that contains a DEBIAN/shlibs or DEBIAN/symbols file and finally
258 in the root directory. If the library is not found in any of
259 those directories, then you get this error.
260
261 If the library not found is in a private directory of the same
262 package, then you want to add the directory to LD_LIBRARY_PATH.
263 If it's in another binary package being built, you want to make
264 sure that the shlibs/symbols file of this package is already
265 created and that LD_LIBRARY_PATH contains the appropriate direc‐
266 tory if it also is in a private directory.
267
268 no dependency information found for library-file (used by binary).
269 The library needed by binary has been found by dpkg-shlibdeps in
270 library-file but dpkg-shlibdeps has been unable to find any
271 dependency information for that library. To find out the depen‐
272 dency, it has tried to map the library to a Debian package with
273 the help of dpkg -S library-file. Then it checked the corre‐
274 sponding shlibs and symbols files in /var/lib/dpkg/info/, and in
275 the various package's build trees (debian/*/DEBIAN/).
276
277 This failure can be caused by a bad or missing shlibs or symbols
278 file in the package of the library. It might also happen if the
279 library is built within the same source package and if the
280 shlibs files has not yet been created (in which case you must
281 fix debian/rules to create the shlibs before calling dpkg-shlib‐
282 deps). Bad RPATH can also lead to the library being found under
283 a non-canonical name (example: /usr/lib/gcc/i486-linux-
284 gnu/4.2.3/../../../../lib/libssl.so.9.8 instead of /usr/lib/lib‐
285 ssl.so.0.9.8) that's not associated to any package, dpkg-shlib‐
286 deps tries to work around this by trying to fallback on a canon‐
287 ical name (using realpath(3)) but it might not always work. It's
288 always best to clean up the RPATH of the binary to avoid prob‐
289 lems.
290
291 Calling dpkg-shlibdeps in verbose mode (-v) will provide much
292 more information about where it tried to find the dependency
293 information. This might be useful if you don't understand why
294 it's giving you this error.
295
297 deb-shlibs(5), deb-symbols(5), dpkg-gensymbols(1).
298
300 Copyright © 1995-1996 Ian Jackson
301 Copyright © 2000 Wichert Akkerman
302 Copyright © 2006 Frank Lichtenheld
303 Copyright © 2007-2008 Raphaël Hertzog
304
305 This is free software; see the GNU General Public Licence version 2 or
306 later for copying conditions. There is NO WARRANTY.
307
308
309
310Debian Project 2009-03-08 dpkg-shlibdeps(1)