Added lots more modules from lintian. Maemian appears to work.
[maemian] / checks / shared-libs.desc
1 Check-Script: shared-libs
2 Author: Christian Schwarz <schwarz@debian.org>
3 Abbrev: shl
4 Type: binary, udeb
5 Unpack-Level: 2
6 Needs-Info: file-info, objdump-info
7 Info: This script checks if a binary package conforms to shared library policy.
8
9 Tag: shlib-with-executable-bit
10 Severity: important
11 Certainty: certain
12 Info: Shared libraries should be mode 0644.
13 Ref: policy 8.1
14
15 Tag: shlib-with-bad-permissions
16 Severity: normal
17 Certainty: certain
18 Info: Shared libraries should be mode 0644.
19 Ref: policy 8.1
20
21 Tag: shlib-with-non-pic-code
22 Severity: serious
23 Certainty: possible
24 Ref: policy 10.2
25 Info: The listed shared libraries contain object code that was compiled 
26  without -fPIC. All object code in shared libraries should be recompiled
27  separately from the static libraries with the -fPIC option. 
28  .
29  Another common mistake that causes this problem is linking with 
30  <tt>gcc -Wl,-shared</tt> instead of <tt>gcc -shared</tt>.
31  .
32  In some cases, exceptions to this rule are warranted. If this is such a
33  case, follow the procedure outlined in Policy and then please document
34  the exception by adding a lintian override to this package.
35  .
36  To check whether a shared library has this problem, run <tt>readelf
37  -d</tt> on the shared library.  If a tag of type TEXTREL is present, the
38  shared library contains non-PIC code.
39
40 Tag: shlib-without-versioned-soname
41 Severity: normal
42 Certainty: possible
43 Ref: policy 10.2, policy 8.6
44 Info: The listed shared library in a public library directory has an
45  SONAME that does not contain any versioning information, either after the
46  <tt>.so</tt> or before it and set off by a hyphen.  It cannot therefore
47  be represented in the shlibs system, and if linked by binaries its
48  interface cannot safely change.  There is no backward-compatible way to
49  migrate programs linked against it to a new ABI.
50  .
51  Normally, this means the shared library is a private library for a
52  particular application and is not meant for general use.  Policy
53  recommends that such libraries be installed in a subdirectory of
54  <tt>/usr/lib</tt> rather than in a public shared library directory.
55  .
56  To view the SONAME of a shared library, run <tt>readelf -d</tt> on the
57  shared library and look for the tag of type SONAME.
58  .
59  There are some special stub libraries or special-purpose shared objects
60  for which an ABI version is not meaningful.  If this is one of those
61  cases, please add an override.
62
63 Tag: ldconfig-symlink-missing-for-shlib
64 Severity: important
65 Certainty: certain
66 Info: The package should not only include the shared library itself, but also
67  the symbolic link which ldconfig would produce. (This is necessary, so 
68  that the link gets removed by dpkg automatically when the package
69  gets removed.)  If the symlink is in the package, check that the SONAME of the
70  library matches the info in the shlibs file.
71 Ref: policy 8.1
72
73 Tag: ldconfig-symlink-before-shlib-in-deb
74 Severity: important
75 Certainty: certain
76 Info: In the package contents list, the shared library has to come before
77  any symbolic links referencing the shared library.
78 Ref: policy 8.1
79
80 Tag: dev-pkg-without-shlib-symlink
81 Severity: normal
82 Certainty: certain
83 Info: A "-dev" package is supposed to install a "libsomething.so" symbolic
84  link referencing the corresponding shared library. Notice how the link name
85  doesn't include the version number -- this is because such a link is used
86  by the linker when other programs are built against this shared library.
87 Ref: policy 8.4
88
89 Tag: non-dev-pkg-with-shlib-symlink
90 Severity: normal
91 Certainty: possible
92 Info: Although this package is not a "-dev" package, it installs a
93  "libsomething.so" symbolic link referencing the corresponding shared
94  library. When the link doesn't include the version number, it is used by
95  the linker when other programs are built against this shared library.
96  .
97  Shared libraries are supposed to place such symbolic links in their
98  respective "-dev" packages, so it is a bug to include it with the main
99  library package.
100  .
101  However, if this is a small package which includes the runtime and the
102  development libraries, this is not a bug. In the latter case, please
103  override this warning.
104 Ref: policy 8.4
105
106 Tag: preinst-calls-ldconfig
107 Severity: normal
108 Certainty: certain
109 Info: The preinst script calls ldconfig.  Calls to ldconfig should only be
110  in postinst and postrm scripts.
111 Ref: policy 8.1.1
112
113 Tag: prerm-calls-ldconfig
114 Severity: normal
115 Certainty: certain
116 Info: The prerm script calls ldconfig.  Calls to ldconfig should only
117  be in postinst and postrm scripts.
118 Ref: policy 8.1.1
119
120 Tag: postrm-unsafe-ldconfig
121 Severity: normal
122 Certainty: certain
123 Info: The postrm script calls ldconfig unsafely.  The postrm
124  must only call ldconfig when given the argument "remove".
125 Ref: policy 8.1.1
126
127 Tag: no-shlibs-control-file
128 Severity: serious
129 Certainty: possible
130 Info: Although the package includes a shared library, the package does not
131  have a shlibs control file. If this is intentional, please override this
132  error.
133 Ref: policy 8.6
134
135 Tag: pkg-has-shlibs-control-file-but-no-actual-shared-libs
136 Severity: important
137 Certainty: certain
138 Info: Although the package does not include any shared libraries, it does
139  have a shlibs control file. If you did include a shared library, check that
140  the SONAME of the library is set and that it matches the contents of the
141  shlibs file.
142  .
143  SONAMEs are set with something like <tt>gcc -Wl,-soname,libfoo.so.0</tt>,
144  where 0 is the major version of the library. If your package uses libtool,
145  then libtool invoked with the right options should be doing this.
146
147 Tag: duplicate-entry-in-shlibs-control-file
148 Severity: important
149 Certainty: certain
150 Info: The shlibs control file contains a duplicate entry.
151
152 Tag: shlib-missing-in-control-file
153 Severity: important
154 Certainty: possible
155 Info: The package contains a shared library that is not listed in the
156  shlibs control file. If this is intentional, please override this error.
157 Ref: policy 8.6
158
159 Tag: unused-shlib-entry-in-control-file
160 Severity: normal
161 Certainty: certain
162 Info: The shlibs control file contains an entry for a shared library that
163  is not installed by this package.
164 Ref: policy 8.6
165
166 Tag: shlibs-declares-dependency-on-other-package
167 Severity: normal
168 Certainty: possible
169 Info: This package declares in its shlibs control file either a dependency
170  on some other package not listed in the Provides of this package or on a
171  version of this package that the package version doesn't satisfy.
172  .
173  Packages should normally only list in their shlibs control file the
174  shared libraries included in that package, and therefore the dependencies
175  listed there should normally be satisfied by either the package itself or
176  one of its Provides.
177  .
178  In unusual circumstances where it's necessary to declare more complex
179  dependencies in the shlibs control file, please add a lintian override
180  for this warning.
181 Ref: policy 8.6
182
183 Tag: ldconfig-symlink-referencing-wrong-file
184 Severity: important
185 Certainty: certain
186 Info: The symbolic link references the wrong file. (It should reference
187  the shared library.)
188 Ref: policy 8.1
189
190 Tag: ldconfig-symlink-is-not-a-symlink
191 Severity: important
192 Certainty: certain
193 Info: The package installs a file with the name, ldconfig would use for
194  the symbolic link to reference the shared library.
195 Ref: policy 8.1
196
197 Tag: postinst-has-useless-call-to-ldconfig
198 Severity: minor
199 Certainty: certain
200 Info: The postinst script calls ldconfig even though no shared libraries are
201  installed in a directory controlled by the dynamic library loader.
202 Ref: policy 8.1.1
203
204 Tag: udeb-postinst-must-not-call-ldconfig
205 Severity: important
206 Certainty: certain
207 Info: The postinst script calls ldconfig, which is an error in udebs.
208  ldconfig is not available and not needed in debian-installer
209
210 Tag: postrm-has-useless-call-to-ldconfig
211 Severity: minor
212 Certainty: certain
213 Info: The postrm script calls ldconfig even though no shared libraries are
214  installed in a directory controlled by the dynamic library loader.
215 Ref: policy 8.1.1
216
217 Tag: postinst-must-call-ldconfig
218 Severity: serious
219 Certainty: certain
220 Info: The package installs shared libraries in a directory controlled by
221  the dynamic library loader. Therefore, the package must call "ldconfig" in
222  its postinst script.
223 Ref: policy 8.1.1
224
225 Tag: postrm-should-call-ldconfig
226 Severity: important
227 Certainty: certain
228 Info: The package installs shared libraries in a directory controlled by
229  the dynamic library loader. Therefore, the package should call "ldconfig"
230  in its postrm script.
231 Ref: policy 8.1.1
232
233 Tag: sharedobject-in-library-directory-missing-soname
234 Severity: important
235 Certainty: possible
236 Info: A shared object was identified in a library directory (a directory
237  in the standard linker path) which doesn't have a SONAME.  This is
238  usually an error.
239  .
240  SONAMEs are set with something like <tt>gcc -Wl,-soname,libfoo.so.0</tt>,
241  where 0 is the major version of the library. If your package uses libtool,
242  then libtool invoked with the right options should be doing this.
243  .
244  To view the SONAME of a shared library, run <tt>readelf -d</tt> on the
245  shared library and look for the tag of type SONAME.
246
247 Tag: shlib-without-PT_GNU_STACK-section
248 Severity: important
249 Certainty: certain
250 Info: The listed shared libraries lacks a PT_GNU_STACK section. This forces
251  the dynamic linker to make the stack executable.
252  .
253  The shared lib is linked either with a non-GNU linker or a linker which is
254  very old. This problem can be fixed with a rebuild.
255  .
256  To see whether a shared library has this section, run <tt>readelf -l</tt>
257  on it and look for a program header of type GNU_STACK.
258
259 Tag: shlib-with-executable-stack
260 Severity: normal
261 Certainty: possible
262 Info: The listed shared libraries declares the stack as executable.
263  .
264  Executable stack is usually an error as it is only needed if the code
265  contains GCC trampolines or similar constructs which uses code on the
266  stack. One possible source for false positives are object files built
267  from assembler files which don't define a proper .note.GNU-stack
268  section.
269  .
270  To see the permissions on the stack, run <tt>readelf -l</tt> on the
271  shared library and look for the program header of type GNU_STACK.  In the
272  flag column, there should not be an E flag set.
273
274 Tag: symbols-file-contains-current-version-with-debian-revision
275 Severity: important
276 Certainty: certain
277 Info: Debian revisions should be stripped from versions in symbols files.
278  Not doing so leads to dependencies unsatisfiable by backports (1.0-1~bpo
279  &lt;&lt; 1.0-1 while 1.0-1~bpo &gt;= 1.0).  If the debian revision can't
280  be stripped because the symbol really appeared between two specific
281  Debian revisions, you should postfix the version with a single "~"
282  (example: 1.0-3~ if the symbol appeared in 1.0-3).
283  .
284  This problem normally means that the symbols were added automatically by
285  dpkg-gensymbols.  dpkg-gensymbols uses the full version number for the
286  dependency associated to any new symbol that it detects.  The maintainer
287  must update the <tt>debian/&lt;package&gt;.symbols</tt> file by adding
288  the new symbols with the corresponding upstream version.
289
290 Tag: symbols-file-contains-debian-revision
291 Severity: normal
292 Certainty: certain
293 Info: Debian revisions should be stripped from versions in symbols files.
294  Not doing so leads to dependencies unsatisfiable by backports (1.0-1~bpo
295  &lt;&lt; 1.0-1 while 1.0-1~bpo &gt;= 1.0).  If the debian revision can't
296  be stripped because the symbol really appeared between two specific
297  Debian revisions, you should postfix the version with a single "~"
298  (example: 1.0-3~ if the symbol appeared in 1.0-3).
299 Ref: dpkg-gensymbols(1), http://wiki.debian.org/UsingSymbolsFiles
300
301 Tag: syntax-error-in-symbols-file
302 Severity: important
303 Certainty: certain
304 Info: The symbols file contains an entry that does not follow the syntax
305  rules for symbols files.
306  .
307  This may be due to the entry appearing out of sequence.
308 Ref: deb-symbols(5)
309
310 Tag: duplicate-entry-in-symbols-control-file
311 Severity: important
312 Certainty: certain
313 Info: The symbols control file contains a duplicate entry.
314
315 Tag: no-symbols-control-file
316 Severity: wishlist
317 Certainty: certain
318 Info: Although the package includes a shared library, the package does not
319  have a symbols control file.
320  .
321  dpkg can use symbols files in order to generate more accurate library
322  dependencies for applications, based on the symbols from the library that
323  are actually used by the application.
324 Ref: dpkg-gensymbols(1), http://wiki.debian.org/UsingSymbolsFiles
325
326 Tag: pkg-has-symbols-control-file-but-no-shared-libs
327 Severity: important
328 Certainty: certain
329 Info: Although the package does not include any shared libraries, it does
330  have a symbols control file. If you did include a shared library, check that
331  the SONAME of the library is set and that it matches the contents of the
332  symbols file.
333  .
334  SONAMEs are set with something like <tt>gcc -Wl,-soname,libfoo.so.0</tt>,
335  where 0 is the major version of the library. If your package uses libtool,
336  then libtool invoked with the right options should be doing this.
337
338 Tag: shlib-missing-in-symbols-control-file
339 Severity: normal
340 Certainty: possible
341 Info: The package contains a shared library that is not listed in the
342  symbols control file. This may not be a problem if, for example,
343  the library is a C++ library.
344
345 Tag: unused-shlib-entry-in-symbols-control-file
346 Severity: normal
347 Certainty: certain
348 Info: The symbols control file contains an entry for a shared library that
349  is not installed by this package.
350
351 Tag: symbols-declares-dependency-on-other-package
352 Severity: normal
353 Certainty: possible
354 Info: This package declares in its symbols control file a dependency on
355  some other package (and not one listed in the Provides of this package).
356  .
357  Packages should normally only list in their symbols control file the
358  shared libraries included in that package, and therefore the dependencies
359  listed there should normally be satisfied by either the package itself or
360  one of its Provides.
361  .
362  In unusual circumstances where it's necessary to declare more complex
363  dependencies in the symbols control file, please add a lintian override
364  for this warning.
365 Ref: policy 8.6
366
367 Tag: invalid-template-id-in-symbols-file
368 Severity: important
369 Certainty: certain
370 Info: The symbol definition refers to an alternative dependency template
371  which is not defined for the library containing the symbol.
372  .
373  The first alternative dependency template for a library the id number
374  of 1, with the ids of subsequent alternative templates increasing in
375  sequence.
376
377 Tag: unknown-meta-field-in-symbols-file
378 Severity: important
379 Certainty: certain
380 Info: The symbols control file contains an unknown meta-information field.
381  .
382  A list of currently supported fields may be found in deb-control(5).
383 Ref: deb-control(5)
384
385 Tag: symbols-declared-but-not-shlib
386 Severity: important
387 Certainty: certain
388 Info: The symbols control file contains dependency and symbol information
389  for a shared library which is not listed in the shlibs control file.
390
391 Tag: shlib-calls-exit
392 Severity: wishlist
393 Certainty: possible
394 Experimental: yes
395 Info: The listed shared library calls the C library exit() or _exit()
396  functions.
397  .
398  In the case of an error, the library should instead return an appropriate
399  error code to the calling program which can then determine how to handle
400  the error, including performing any required clean-up.
401  .
402  In most cases, removing the call should be discussed with upstream,
403  particularly as it may produce an ABI change.
404
405 Tag: incorrect-libdir-in-la-file
406 Severity: important
407 Certainty: possible
408 Info: The given .la file points to a libdir other than the path where it is
409  installed.  This can be caused by resetting <tt>prefix</tt> at make install
410  time instead of using <tt>DESTDIR</tt>.  The incorrect path will cause
411  packages linking to this library using libtool to build incorrectly (adding
412  incorrect paths to RPATH, for example).