1 Installing the GNU C Library
2 ****************************
4 Before you do anything else, you should read the file `FAQ' found at
5 the top level of the source tree. This file answers common questions
6 and describes problems you may experience with compilation and
7 installation. It is updated more frequently than this manual.
9 Two components of GNU Libc are distributed as "add-on" bundles
10 separate from the main distribution. Unless you are doing an unusual
11 installation, you should get them both. Support for the `crypt'
12 function is distributed separately because of US export restrictions.
13 If you are outside the US or Canada, you must get `crypt' support from
14 a site outside the US, such as `ftp.ifi.uio.no'. (Most non-US mirrors
15 of `ftp.gnu.org' will have it too.) The file you need is
16 `glibc-crypt-VERSION.tar.gz'. Support for POSIX threads is maintained
17 by someone else, so it's in a separate package. At the moment it is
18 only available for Linux systems; this will change in the future. Get
19 it from the same place you got the main bundle; the file is
20 `glibc-linuxthreads-VERSION.tar.gz'. Both add-on bundles should be
21 unpacked into the top level of the libc source tree.
23 You will need recent versions of several GNU tools: definitely GCC
24 and GNU Make, and possibly others. *Note Tools for Installation::,
27 Configuring and compiling GNU Libc
28 ==================================
30 GNU Libc cannot be compiled in the source directory. You must
31 create a separate directory for the object files. This directory
32 should be outside the source tree. For example, if you have unpacked
33 the glibc sources in `/src/gnu/glibc-2.1.0', create a directory
34 `/src/gnu/glibc-build' to put the object files in.
36 From your object directory, run the shell script `configure' found
37 at the top level of the source tree. In the scenario above, you'd type
39 $ ../glibc-2.1.0/configure ARGS...
41 `configure' takes many options, but you can get away with knowing only
42 two: `--enable-add-ons' and `--prefix'. The `--enable-add-ons' option
43 tells configure to use all the add-on bundles it finds in the source
44 directory. Since important functionality is provided in add-ons, you
45 should always give this option. The `--prefix' option tells configure
46 where you want glibc installed. This defaults to `/usr/local'. If you
47 are installing glibc as your primary C library, give the option
48 `--prefix=/usr', which will put components in `/usr' or `/' as
51 It may also be useful to set the CC and CFLAGS variables in the
52 environment when running `configure'. CC selects the C compiler that
53 will be used, and CFLAGS sets optimization options for the compiler.
55 Here are all the useful options known by `configure':
58 Install machine-independent data files in subdirectories of
59 `DIRECTORY'. The default is to install in `/usr/local'.
61 `--exec-prefix=DIRECTORY'
62 Install the library and other machine-dependent files in
63 subdirectories of `DIRECTORY'. The default is to the `--prefix'
64 directory if that option is given, or `/usr/local' otherwise.
66 `--with-headers=DIRECTORY'
67 Look for kernel header files in DIRECTORY, not `/usr/include'.
68 Glibc needs information from the kernel's private header files.
69 It will normally look in `/usr/include' for them, but if you give
70 this option, it will look in DIRECTORY instead.
72 This option is primarily of use on a system where the headers in
73 `/usr/include' come from an older version of glibc. Conflicts can
74 occasionally happen in this case. Note that Linux libc5 qualifies
75 as an older version of glibc. You can also use this option if you
76 want to compile glibc with a newer set of kernel headers than the
77 ones found in `/usr/include'.
79 `--enable-add-ons[=LIST]'
80 Enable add-on packages in your source tree. If this option is
81 given with no list, it enables all the add-on packages it finds.
82 If you do not wish to use some add-on package that you have
83 present in your source tree, give this option a list of the
84 add-ons that you *do* want used, like this:
85 `--enable-add-ons=crypt,linuxthreads'
87 `--with-binutils=DIRECTORY'
88 Use the binutils (assembler and linker) in `DIRECTORY', not the
89 ones the C compiler would default to. You could use this option if
90 the default binutils on your system cannot deal with all the
91 constructs in the GNU C library. (`configure' will detect the
92 problem and suppress these constructs, so the library will still
93 be usable, but functionality may be lost--for example, you can not
94 build a shared libc with old binutils.)
97 Use this option if your computer lacks hardware floating-point
98 support and your operating system does not emulate an FPU.
101 Don't build static libraries. Static libraries aren't that useful
102 these days, but we recommend you build them in case you need them.
105 Don't build shared libraries even if we could. Not all systems
106 support shared libraries; you need ELF support and (currently) the
110 Don't build libraries with profiling information. You may want to
111 use this option if you don't plan to do profiling.
114 Use maximum optimization for the normal (static and shared)
115 libraries, and compile separate static libraries with debugging
116 information and no optimisation. We recommend against this. The
117 extra optimization doesn't gain you much, it may provoke compiler
118 bugs, and you won't be able to trace bugs through the C library.
120 `--disable-versioning'
121 Don't compile the shared libraries with symbol version information.
122 Doing this will make the library that's built incompatible with old
123 binaries, so it's not recommended.
125 `--enable-static-nss'
126 Compile static versions of the NSS (Name Service Switch) libraries.
127 This is not recommended because it defeats the purpose of NSS; a
128 program linked statically with the NSS libraries cannot be
129 dynamically reconfigured to use a different name database.
131 `--build=BUILD-SYSTEM'
133 These options are for cross-compiling. If you give them both and
134 BUILD-SYSTEM is different from HOST-SYSTEM, `configure' will
135 prepare to cross-compile glibc from BUILD-SYSTEM to be used on
136 HOST-SYSTEM. You'll probably need the `--with-headers' option
137 too, and you may have to override CONFIGURE's selection of the
138 compiler and/or binutils.
140 If you give just one of these, `configure' will get confused. If
141 `configure' doesn't correctly guess your system type for a native
142 build, report that as a bug.
144 To build the library and related programs, type `make'. This will
145 produce a lot of output, some of which may look like errors from `make'
146 but isn't. Look for error messages from `make' containing `***'.
147 Those indicate that something is really wrong.
149 The compilation process takes several hours even on fast hardware.
150 Expect at least two hours for the default configuration on i586 for
151 Linux. For Hurd times are much longer. Except for EGCS 1.1 (and later
152 versions of EGCS), all supported versions of GCC have a problem which
153 causes them to take several minutes to compile certain files in the
154 iconvdata directory. Do not panic if the compiler appears to hang.
156 If you want to run a parallel make, you can't just give `make' the
157 `-j' option, because it won't be passed down to the sub-makes.
158 Instead, edit the generated `Makefile' and uncomment the line
160 # PARALLELMFLAGS = -j 4
162 You can change the `4' to some other number as appropriate for your
165 To build and run some test programs which exercise some of the
166 library facilities, type `make check'. This should complete
167 successfully; if it doesn't, do not use the built library, and report a
168 bug. *Note Reporting Bugs::, for how to do that. Note that some of
169 the tests assume they are not being run by `root'. We recommend you
170 compile and test glibc as an unprivileged user.
172 To format the `GNU C Library Reference Manual' for printing, type
173 `make dvi'. You need a working TeX installation to do this.
175 To install the library and its header files, and the Info files of
176 the manual, type `make install'. This will build things if necessary,
177 before installing them. If you want to install the files in a different
178 place than the one specified at configuration time you can specify a
179 value for the Makefile variable `install_root' on the command line.
180 This is useful to create chroot'ed environment or to prepare binary
183 Recommended Tools for Compilation
184 =================================
186 We recommend installing the following GNU tools before attempting to
187 build the GNU C library:
191 You need the latest version of GNU `make'. Modifying the GNU C
192 Library to work with other `make' programs would be so hard that we
193 recommend you port GNU `make' instead. *Really.* We recommend
194 version GNU `make' version 3.75 or 3.77. All earlier versions
195 have severe bugs or lack features. Version 3.76 is known to have
196 bugs which only show up in big projects like GNU `libc'. Version
197 3.76.1 seems OK but some people have reported problems.
201 The GNU C library can only be compiled with the GNU C compiler
202 family. We recommend EGCS 1.0.3 or higher. GCC 2.8.1 and older
203 versions of EGCS may have problems, particularly on non-Intel
204 architectures. GCC 2.7.x has catastrophic bugs and cannot be used
207 * GNU `binutils' 2.8.1.0.23, 2.9.1, or 2.9.0.15
209 You must use GNU binutils (as and ld) if you want to build a shared
210 library. Even if you don't, we recommend you use them anyway. No
211 one has tested compilation with non-GNU binutils in a long time.
213 The quality of binutils releases has varied a bit recently. The
214 bugs are in obscure features, but glibc uses quite a few of those.
215 2.8.1.0.23, 2.9.1, and 2.9.0.15 are known to work. Versions after
216 2.8.1.0.23 may or may not work. Older versions definitely don't.
220 To correctly translate and install the Texinfo documentation you
221 need this version of the `texinfo' package. Earlier versions do
222 not understand all the tags used in the document, and the
223 installation mechanisms for the info files is not present or works
226 On some Debian Linux based systems the `install-info' program
227 supplied with the system works differently from the one we expect.
228 You must therefore run `make install' like this:
230 make INSTALL_INFO=/path/to/GNU/install-info install
232 * GNU `awk' 3.0, or some other POSIX awk
234 Awk is used in several places to generate files. The scripts
235 should work with any POSIX-compliant awk implementation; GNU awk
236 3.0 and `mawk' 1.3 are known to work.
240 Perl is not required, but it is used if present to test the
241 installation. We may decide to use it elsewhere in the future.
243 If you change any of the `configure.in' files you will also need
245 * GNU `autoconf' 2.12
247 and if you change any of the message translation files you will need
249 * GNU `gettext' 0.10.35 or later
251 You may also need these packages if you upgrade your source tree using
252 patches, although we try to avoid this.
254 Supported Configurations
255 ========================
257 The GNU C Library currently supports configurations that match the
270 Former releases of this library (version 1.09.1 and perhaps earlier
271 versions) used to run on the following configurations:
282 iX86-force_cpu386-none
296 Since no one has volunteered to test and fix these configurations,
297 they are not supported at the moment. They probably don't compile;
298 they definitely don't work anymore. Porting the library is not hard.
299 If you are interested in doing a port, please contact the glibc
300 maintainers by sending electronic mail to <bug-glibc@gnu.org>.
302 Each case of `iX86' can be `i386', `i486', `i586', or `i686'. All
303 of those configurations produce a library that can run on any of these
304 processors. The library will be optimized for the specified processor,
305 but will not use instructions not available on all of them.
307 While no other configurations are supported, there are handy aliases
308 for these few. (These aliases work in other GNU software as well.)
311 hp320-bsd4.3 hp300bsd
320 sun4-solaris2.N sun4-sunos5.N
326 There are probably bugs in the GNU C library. There are certainly
327 errors and omissions in this manual. If you report them, they will get
328 fixed. If you don't, no one will ever know about them and they will
329 remain unfixed for all eternity, if not longer.
331 To report a bug, first you must find it. Hopefully, this will be the
332 hard part. Once you've found a bug, make sure it's really a bug. A
333 good way to do this is to see if the GNU C library behaves the same way
334 some other C library does. If so, probably you are wrong and the
335 libraries are right (but not necessarily). If not, one of the libraries
338 Once you're sure you've found a bug, try to narrow it down to the
339 smallest test case that reproduces the problem. In the case of a C
340 library, you really only need to narrow it down to one library function
341 call, if possible. This should not be too difficult.
343 The final step when you have a simple test case is to report the bug.
344 When reporting a bug, send your test case, the results you got, the
345 results you expected, what you think the problem might be (if you've
346 thought of anything), your system type, and the version of the GNU C
347 library which you are using. Also include the files `config.status'
348 and `config.make' which are created by running `configure'; they will
349 be in whatever directory was current when you ran `configure'.
351 If you think you have found some way in which the GNU C library does
352 not conform to the ISO and POSIX standards (*note Standards and
353 Portability::.), that is definitely a bug. Report it!
355 Send bug reports to the Internet address <bug-glibc@gnu.org> using
356 the `glibcbug' script which is installed by the GNU C library. If you
357 have other problems with installation or use, please report those as
360 If you are not sure how a function should behave, and this manual
361 doesn't tell you, that's a bug in the manual. Report that too! If the
362 function's behavior disagrees with the manual, then either the library
363 or the manual has a bug, so report the disagreement. If you find any
364 errors or omissions in this manual, please report them to the Internet
365 address <bug-glibc-manual@gnu.org>. If you refer to specific sections
366 when reporting on the manual, please include the section names for
367 easier identification.