libc6-migration.txt 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. Debian library policy supplement draft for libc5->libc6 migration
  2. This document is meant to tell what a Debian package providing a
  3. library should do to support both libc6 (glibc2) and libc5.
  4. Note that these requirements are for Debian 2.0 (codename hamm).
  5. Contents
  6. 1. Run time packages
  7. 2. Development packages
  8. 3. Source packages
  9. 4. Requirements on libraries for Debian 2.0
  10. 5. Conflicts and Dependencies
  11. 6. Handling bugfix releases for Debian 1.3 (bo)
  12. 7. Requirements on compiler packages
  13. 1. Run time packages
  14. A package providing a shared library has to support both C library
  15. packages, libc5 and libc6 based libraries. This must be done using
  16. two Debian packages, each depending on the correct C library
  17. package.
  18. The package naming convention currently suggests to name these
  19. packages as follows. Some packages (mostly from base) may use
  20. locations in /lib.
  21. based on | package name | library location
  22. --------------------------------------------
  23. libc6 | libfoog [1]| /usr/lib/libfoo.so.<ver>
  24. libc5 | libfoo | /usr/lib/libc5-compat/libfoo.so.<ver> [2]
  25. If a library runtime package contains files that are needed by
  26. both versions of the library, a new package should be made for
  27. just these files that both other packages depend on.
  28. This package naming convention does _not_ apply if a package uses
  29. different sonames for libc5 and libc6 based packages
  30. There are two exceptions from this rule. The shared linker
  31. ld-linux.so.1 and the C library files libc.so.5 and libm.so.5
  32. should still be located in /lib, not in /lib/libc5-compat.
  33. Packages based on X have to use /usr/X11R6 as prefix, not /usr.
  34. Note that the X libraries are designed to work with both C libraries.
  35. 2. Development packages
  36. The Debian policy requires that all files needed for compiling/linking
  37. other packages with the library are in a separate package, the
  38. development package. Up to now this package simply was called
  39. libfoo-dev. As packages based on libc5 and libc6 usually cannot
  40. use the same development files there has to be a clear statement
  41. how to separate these. So for now the following packages are
  42. required:
  43. based on | package name | hierarchy locations
  44. ---------------------------------------------------------------
  45. libc6 | libfoog-dev | /usr/{lib,include}
  46. libc5 | libfoo-altdev | /usr/<a>-linuxlibc1/{lib,include}
  47. Note that <a> usually is i486, but may not be hardcoded in
  48. debian/rules. It should be obtained using
  49. dpkg --print-gnu-build-architecture
  50. Remember that the libfoo-altdev package has to include symlinks
  51. /usr/<a>-linuxlibc1/lib/libfoo.so -> /usr/lib/libc5-compat/libfoo.so.<ver>
  52. to enable using the shared libraries when compiling.
  53. All documentation that is not depending on whether the library was
  54. compiled for libc5 or for libc6 should be either part of the
  55. libfoog-dev package or be put into a separate package if it is
  56. large. In particular this includes manpages which _have_ to be part
  57. of the libfoog-dev package.
  58. Note that the choice to base Debian 2.0 on libc6 fixed the fact
  59. that the main locations will be used for libc6 packages. The
  60. alternate locations are used for libc5 based packages.
  61. This decision does not necessarily mean that by default the
  62. compiler uses the libc6 packages, please read section 4 for more
  63. information. Using a four-way approach for library locations
  64. (standard and alternate locations for libc6 and libc5 based
  65. packages) will make Debian systems inconsistent with each other,
  66. something we should avoid at (nearly) all costs.
  67. 3. Source packages
  68. The source package name should _not_ be modified for hamm.
  69. If a bugfix for bo has to be released, use bo's source package to
  70. extract the bo source and add for each hamm release a line to
  71. debian/changelog stating that this release was a hamm release.
  72. Make your bugfix changes, including changes to the control file
  73. according to section 6.
  74. Then unpack the hamm source again, update debian/changelog and
  75. debian/control to figure the bo release, and release a new hamm
  76. package (including the bugfix, if it affects hamm as well). [3]
  77. 4. Requirements on libraries for Debian 2.0
  78. Libraries (regardless of which library they're compiled against) need
  79. to have runtime dependencies on one of libc, libdl or libm to enable
  80. the shared linker to determine which library to use for a binary.
  81. These runtime dependencies are _NOT_ dependencies in the Debian
  82. way, but dependencies generated by the linker when generating the
  83. shared library. See the binutils manual for more information.
  84. In general we want libraries compiled for libc6 to be thread-safe.
  85. This is, however, not practical or feasible for every library
  86. package. Making a library thread-safe involves quite a lot of work,
  87. much of it nontrivial.
  88. Thread-safe means that the following changes must be made to the
  89. library packages:
  90. - compile the library using -D_REENTRANT or -D_THREAD_SAFE
  91. - there may be no permanent data residing in the library memory that
  92. can be different for different threads.
  93. this means in the first place no static or global variables that
  94. are not in some way protected from access by a different threads
  95. via mutexes.
  96. - all write access to files from a library must be both protected
  97. using some file locking mechanism in addition to using mutexes.
  98. - at least some library functions must be protected from being
  99. used at the same time by two threads sharing the same memory
  100. space. This is done using mutexes.
  101. As these usually are all nontrivial changes to a library if it isn't
  102. thread-safe already (in which case just using -D_REENTRANT should
  103. be used in addition to whatever the library uses to support threads),
  104. I suggest that no-one starts doing this without getting in contact with
  105. the upstream maintainer(s).
  106. If a library has a thread-safe version, the debian package should
  107. use this. The performance deficits usually are very small when not
  108. linking to libpthreads so only if there are serious reasons, the
  109. debian package may include the non-thread-safe version.
  110. There will be a list available that lists all libraries part of
  111. Debian and their current status regarding compliance with these
  112. standard requirements. This list will be posted regularly to
  113. debian-devel by Helmut Geyer <Helmut.Geyer@iwr.uni-heidelberg.de>.
  114. 5. Conflicts & Dependencies for hamm packages
  115. The libfoog package _has_ to conflict with all versions of the
  116. libfoo package before it was made to use the libc5-compat
  117. directory. Furthermore it should depend on libc6.
  118. The libfoog-dev package must depend on libc6-dev and the libfoog
  119. package of the same release. It has to conflict with the libfoo-dev
  120. package.
  121. The hamm libfoo package has to depend on libc6 and has to conflict
  122. with libfoo-dev and libc5-dev.
  123. The libfoo-altdev package has to depend on the libc5-altdev and
  124. libfoo package of the same release.
  125. 6. Handling bugfixes for Debian 1.3 (bo)
  126. Using the dependencies from Section 5. there will be problems with
  127. making bugfix releases for bo. These have to be handled carefully
  128. as otherwise there may be tremendous problems for people using
  129. hamm systems.
  130. As there is one package name used for both hamm and bo that stays
  131. the same (libfoo), we have to very careful.
  132. The following steps should be followed:
  133. i) when making a bo bugfix release, be sure to make a hamm release
  134. at the same time, using a higher release number for the hamm
  135. release. Update the hamm package's conflicts according to
  136. section 5.
  137. ii) Any bo package for libfoo _has_ to conflict with libc6,
  138. libfoo-altdev and libfoog.
  139. iii)The libfoo-dev package has to conflict with libc5-altdev and
  140. has to depend on libc5-dev.
  141. 7. Requirements on compiler packages
  142. The compiler and binutils packages have to provide working
  143. development environments for both C libraries. Basically (that is
  144. from the compiler standpoint) there is no real difference between
  145. the two environments, only some paths and automatic definitions
  146. have to be changed. All this can be done (and is in fact done) by
  147. supplying a different specs file in a different location.
  148. The gcc packages do this as follows:
  149. The gcc package uses libc6 by default and is installed in /usr/bin.
  150. The alt-gcc package uses libc5 by default and is located in
  151. /usr/i486-linuxlibc1/bin. By prepending this to the path this can
  152. be made the default.
  153. These requirements are fulfilled by the current gcc packages.
  154. Remarks:
  155. [1] the name of a library package often includes the major version
  156. number of the library. If so, the 'g' should come before this
  157. number, e.g. libgdbmg1 as package name for the libc6 based
  158. runtime package for libgdbm.
  159. [2] The location ../libc5-compat was introduced in the ldso package. As
  160. ldso is a package on all linus distributions we'll keep it for
  161. compatibility with other distributions even though
  162. /usr/i486-linuxlibc1/lib would be more consistent.
  163. [3] An example for relevant sections of the changelogs for a bugfix
  164. release for both bo and hamm (with the last bo release being
  165. libfoo 1.7.54-6 released on Mon, 16 Jun 1997 and the last hamm
  166. release being libfoo 1.7.54-8 released on Wed, 18 Jun 1997):
  167. -=-=-=-=-=-=-=-=-= bo changelog =-=-=-=-=-=-=-=-=-
  168. libfoo (1.7.54-9) stable; urgency=low
  169. * fixed bug #543547884
  170. -- J.D. Maintainer <jdm@debian.org> Fri, 20 Jun 1997 08:32:03 +0200
  171. libfoo (1.7.54-8) unstable; urgency=low
  172. * hamm release
  173. -- J.D. Maintainer <jdm@debian.org> Fri, 20 Jun 1997 08:32:03 +0200
  174. libfoo (1.7.54-7) unstable; urgency=low
  175. * hamm release
  176. -- J.D. Maintainer <jdm@debian.org> Fri, 20 Jun 1997 08:32:03 +0200
  177. libfoo (1.7.54-6) stable; urgency=low
  178. * added handling of bar.
  179. -- J.D. Maintainer <jdm@debian.org> Mon, 16 Jun 1997 18:45:14 +0200
  180. -=-=-=-=-=-=-=-=-= hamm changelog =-=-=-=-=-=-=-=-=-
  181. libfoo (1.7.54-10) unstable; urgency=low
  182. * fixed bug #543547884
  183. -- J.D. Maintainer <jdm@debian.org> Fri, 20 Jun 1997 08:52:09 +0200
  184. libfoo (1.7.54-9) stable; urgency=low
  185. * bo release
  186. -- J.D. Maintainer <jdm@debian.org> Fri, 20 Jun 1997 08:52:09 +0200
  187. libfoo (1.7.54-8) unstable; urgency=low
  188. * finally made package compliant with those strange policy for hamm
  189. libs.
  190. -- J.D. Maintainer <jdm@debian.org> Wed, 18 Jun 1997 15:34:12 +0200
  191. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  192. --
  193. Helmut Geyer Helmut.Geyer@iwr.uni-heidelberg.de
  194. public PGP key available : finger geyer@saturn.iwr.uni-heidelberg.de