.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "dpkg-gensymbols 1" .TH dpkg-gensymbols 1 2024-08-01 1.22.11 "dpkg suite" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME dpkg\-gensymbols \- generate symbols files (shared library dependency information) .SH SYNOPSIS .IX Header "SYNOPSIS" \&\fBdpkg-gensymbols\fR [\fIoption\fR...] .SH DESCRIPTION .IX Header "DESCRIPTION" \&\fBdpkg-gensymbols\fR scans a temporary build tree (debian/tmp by default) looking for libraries and generates a \fIsymbols\fR file describing them. This file, if non-empty, is then installed in the DEBIAN subdirectory of the build tree so that it ends up included in the control information of the package. .PP When generating those files, it uses as input some symbols files provided by the maintainer. It looks for the following files (and uses the first that is found): .IP \(bu 4 debian/\fIpackage\fR.symbols.\fIarch\fR .IP \(bu 4 debian/symbols.\fIarch\fR .IP \(bu 4 debian/\fIpackage\fR.symbols .IP \(bu 4 debian/symbols .PP The main interest of those files is to provide the minimal version associated to each symbol provided by the libraries. Usually it corresponds to the first version of that package that provided the symbol, but it can be manually incremented by the maintainer if the ABI of the symbol is extended without breaking backwards compatibility. It's the responsibility of the maintainer to keep those files up-to-date and accurate, but \fBdpkg-gensymbols\fR helps with that. .PP When the generated symbols files differ from the maintainer supplied one, \fBdpkg-gensymbols\fR will print a diff between the two versions. Furthermore if the difference is too significant, it will even fail (you can customize how much difference you can tolerate, see the \fB\-c\fR option). .PP This program was introduced in dpkg 1.14.8. .SH "MAINTAINING SYMBOLS FILES" .IX Header "MAINTAINING SYMBOLS FILES" The base interchange format of the symbols file is described in \&\fBdeb\-symbols\fR\|(5), which is used by the symbols files included in binary packages. These are generated from template symbols files with a format based on the former, described in \fBdeb\-src\-symbols\fR\|(5) and included in source packages. .PP The symbols files are really useful only if they reflect the evolution of the package through several releases. Thus the maintainer has to update them every time that a new symbol is added so that its associated minimal version matches reality. .PP The diffs contained in the build logs can be used as a starting point, but the maintainer, additionally, has to make sure that the behaviour of those symbols has not changed in a way that would make anything using those symbols and linking against the new version, stop working with the old version. .PP In most cases, the diff applies directly to the debian/\fIpackage\fR.symbols file. That said, further tweaks are usually needed: it's recommended for example to drop the Debian revision from the minimal version so that backports with a lower version number but the same upstream version still satisfy the generated dependencies. If the Debian revision can't be dropped because the symbol really got added by the Debian specific change, then one should suffix the version with \(oq\fB~\fR\(cq. .PP Before applying any patch to the symbols file, the maintainer should double-check that it's sane. Public symbols are not supposed to disappear, so the patch should ideally only add new lines. .PP Note that you can put comments in symbols files. .PP Do not forget to check if old symbol versions need to be increased. There is no way \fBdpkg-gensymbols\fR can warn about this. Blindly applying the diff or assuming there is nothing to change if there is no diff, without checking for such changes, can lead to packages with loose dependencies that claim they can work with older packages they cannot work with. This will introduce hard to find bugs with (partial) upgrades. .SS "Good library management" .IX Subsection "Good library management" A well-maintained library has the following features: .IP \(bu 4 its API is stable (public symbols are never dropped, only new public symbols are added) and changes in incompatible ways only when the SONAME changes; .IP \(bu 4 ideally, it uses symbol versioning to achieve ABI stability despite internal changes and API extension; .IP \(bu 4 it doesn't export private symbols (such symbols can be tagged optional as workaround). .PP While maintaining the symbols file, it's easy to notice appearance and disappearance of symbols. But it's more difficult to catch incompatible API and ABI change. Thus the maintainer should read thoroughly the upstream changelog looking for cases where the rules of good library management have been broken. If potential problems are discovered, the upstream author should be notified as an upstream fix is always better than a Debian specific work-around. .SH OPTIONS .IX Header "OPTIONS" .IP \fB\-P\fR\fIpackage-build-dir\fR 4 .IX Item "-Ppackage-build-dir" Scan \fIpackage-build-dir\fR instead of debian/tmp. .IP \fB\-p\fR\fIpackage\fR 4 .IX Item "-ppackage" Define the package name. Required if more than one binary package is listed in debian/control (or if there's no debian/control file). .IP \fB\-v\fR\fIversion\fR 4 .IX Item "-vversion" Define the package version. Defaults to the version extracted from debian/changelog. Required if called outside of a source package tree. .IP \fB\-e\fR\fIlibrary-file\fR 4 .IX Item "-elibrary-file" Only analyze libraries explicitly listed instead of finding all public libraries. You can use shell patterns used for pathname expansions (see the File::Glob manual page for details) in \fIlibrary-file\fR to match multiple libraries with a single argument (otherwise you need multiple \fB\-e\fR). .IP \fB\-l\fR\fIdirectory\fR 4 .IX Item "-ldirectory" Prepend \&\fIdirectory\fR to the list of directories to search for private shared libraries (since dpkg 1.19.1). This option can be used multiple times. .Sp \&\fBNote\fR: Use this option instead of setting \fBLD_LIBRARY_PATH\fR, 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. .IP \fB\-I\fR\fIfilename\fR 4 .IX Item "-Ifilename" Use \fIfilename\fR as reference file to generate the symbols file that is integrated in the package itself. .IP \fB\-O\fR[\fIfilename\fR] 4 .IX Item "-O[filename]" Print the generated symbols file to standard output or to \fIfilename\fR if specified, rather than to \&\fBdebian/tmp/DEBIAN/symbols\fR (or \&\fIpackage-build-dir\fR\fB/DEBIAN/symbols\fR if \&\fB\-P\fR was used). If \fIfilename\fR is pre-existing, its contents are used as basis for the generated symbols file. You can use this feature to update a symbols file so that it matches a newer upstream version of your library. .IP \fB\-t\fR 4 .IX Item "-t" Write the symbol file in template mode rather than the format compatible with \&\fBdeb\-symbols\fR\|(5). The main difference is that in the template mode symbol names and tags are written in their original form contrary to the post-processed symbol names with tags stripped in the compatibility mode. Moreover, some symbols might be omitted when writing a standard \&\fBdeb\-symbols\fR\|(5) file (according to the tag processing rules) while all symbols are always written to the symbol file template. .IP \fB\-c\fR\fI[0\-4]\fR 4 .IX Item "-c[0-4]" Define the checks to do when comparing the generated symbols file with the template file used as starting point. By default the level is 1. Increasing levels do more checks and include all checks of lower levels. .RS 4 .IP "Level 0" 4 .IX Item "Level 0" Never fails. .IP "Level 1" 4 .IX Item "Level 1" Fails if some symbols have disappeared. .IP "Level 2" 4 .IX Item "Level 2" Fails if some new symbols have been introduced. .IP "Level 3" 4 .IX Item "Level 3" Fails if some libraries have disappeared. .IP "Level 4" 4 .IX Item "Level 4" Fails if some libraries have been introduced. .RE .RS 4 .Sp This value can be overridden by the environment variable \&\fBDPKG_GENSYMBOLS_CHECK_LEVEL\fR. .RE .IP \fB\-q\fR 4 .IX Item "-q" Keep quiet and never generate a diff between generated symbols file and the template file used as starting point or show any warnings about new/lost libraries or new/lost symbols. This option only disables informational output but not the checks themselves (see \fB\-c\fR option). .IP \fB\-a\fR\fIarch\fR 4 .IX Item "-aarch" Assume \fIarch\fR as host architecture when processing symbol files. Use this option to generate a symbol file or diff for any architecture provided its binaries are already available. .IP \fB\-d\fR 4 .IX Item "-d" Enable debug mode. Numerous messages are displayed to explain what \&\fBdpkg-gensymbols\fR does. .IP \fB\-V\fR 4 .IX Item "-V" Enable verbose mode. The generated symbols file contains deprecated symbols as comments. Furthermore in template mode, pattern symbols are followed by comments listing real symbols that have matched the pattern. .IP "\fB\-?\fR, \fB\-\-help\fR" 4 .IX Item "-?, --help" Show the usage message and exit. .IP \fB\-\-version\fR 4 .IX Item "--version" Show the version and exit. .SH ENVIRONMENT .IX Header "ENVIRONMENT" .IP \fBDEB_HOST_ARCH\fR 4 .IX Item "DEB_HOST_ARCH" Sets the host architecture if the \fB\-\-arch\fR option has not be specified. .IP \fBDPKG_GENSYMBOLS_CHECK_LEVEL\fR 4 .IX Item "DPKG_GENSYMBOLS_CHECK_LEVEL" Overrides the command check level, even if the \fB\-c\fR command-line argument was given (note that this goes against the common convention of command-line arguments having precedence over environment variables). .IP \fBDPKG_COLORS\fR 4 .IX Item "DPKG_COLORS" Sets the color mode (since dpkg 1.18.5). The currently accepted values are: \fBauto\fR (default), \fBalways\fR and \&\fBnever\fR. .IP \fBDPKG_NLS\fR 4 .IX Item "DPKG_NLS" 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: \fB0\fR and \fB1\fR (default). .SH "SEE ALSO" .IX Header "SEE ALSO" , , , \&\fBdeb\-src\-symbol\fR\|(5), \&\fBdeb\-symbols\fR\|(5), \&\fBdpkg\-shlibdeps\fR\|(1).