This file is indexed.

/usr/share/doc/glibc-doc/html/libc_36.html is in glibc-doc 2.15-0ubuntu10.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<html>
<!-- This file documents the GNU C library.

This is Edition 0.13, last updated 2011-07-19,
of The GNU C Library Reference Manual, for version
2.14 (Ubuntu EGLIBC 2.15-0ubuntu10) .

Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002,
2003, 2007, 2008, 2010, 2011 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "Free Software Needs Free Documentation"
and "GNU Lesser General Public License", the Front-Cover texts being
"A GNU Manual", and with the Back-Cover Texts as in (a) below.  A
copy of the license is included in the section entitled "GNU Free
Documentation License".

(a) The FSF's Back-Cover Text is: "You have the freedom to
copy and modify this GNU manual.  Buying copies from the FSF
supports it in developing GNU and promoting software freedom."
 -->
<!-- Created on April 20, 2012 by texi2html 1.82
texi2html was written by: 
            Lionel Cons <Lionel.Cons@cern.ch> (original author)
            Karl Berry  <karl@freefriends.org>
            Olaf Bachmann <obachman@mathematik.uni-kl.de>
            and many others.
Maintained by: Many creative people.
Send bugs and suggestions to <texi2html-bug@nongnu.org>
-->
<head>
<title>The GNU C Library: C. Installing the GNU C Library</title>

<meta name="description" content="The GNU C Library: C. Installing the GNU C Library">
<meta name="keywords" content="The GNU C Library: C. Installing the GNU C Library">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2html 1.82">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
pre.display {font-family: serif}
pre.format {font-family: serif}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: serif; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: serif; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.roman {font-family:serif; font-weight:normal;}
span.sansserif {font-family:sans-serif; font-weight:normal;}
ul.toc {list-style: none}
-->
</style>


</head>

<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">

<a name="Installation"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="libc_35.html#Library-Summary" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Configuring-and-compiling" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="libc_35.html#Library-Summary" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="libc.html#Top" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="libc_37.html#Maintenance" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="libc.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="libc_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="libc_42.html#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="libc_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Installing-the-GNU-C-Library"></a>
<h1 class="appendix">C. Installing the GNU C Library</h1>

<p>Before you do anything else, you should read the file &lsquo;<tt>FAQ</tt>&rsquo; located
at the top level of the source tree.  This file answers common questions
and describes problems you may experience with compilation and
installation.  It is updated more frequently than this manual.
</p>
<p>Features can be added to GNU Libc via <em>add-on</em> bundles.  These are
separate tar files, which you unpack into the top level of the source
tree.  Then you give <code>configure</code> the &lsquo;<samp>--enable-add-ons</samp>&rsquo; option
to activate them, and they will be compiled into the library.
</p>
<p>You will need recent versions of several GNU tools: definitely GCC and
GNU Make, and possibly others.  See section <a href="#Tools-for-Compilation">Recommended Tools for Compilation</a>, below.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Configuring-and-compiling">C.1 Configuring and compiling GNU Libc</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">   How to compile and test GNU libc.
</td></tr>
<tr><td align="left" valign="top"><a href="#Running-make-install">C.2 Installing the C Library</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">        How to install it once you&rsquo;ve got it
 compiled.
</td></tr>
<tr><td align="left" valign="top"><a href="#Tools-for-Compilation">C.3 Recommended Tools for Compilation</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">       You&rsquo;ll need these first.
</td></tr>
<tr><td align="left" valign="top"><a href="#Linux">C.4 Specific advice for GNU/Linux systems</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"></td></tr>
<tr><td align="left" valign="top"><a href="#Reporting-Bugs">C.5 Reporting Bugs</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">              So they&rsquo;ll get fixed.
</td></tr>
</table>

<hr size="6">
<a name="Configuring-and-compiling"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Installation" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Running-make-install" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Installation" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Installation" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="libc_37.html#Maintenance" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="libc.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="libc_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="libc_42.html#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="libc_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Configuring-and-compiling-GNU-Libc"></a>
<h2 class="appendixsec">C.1 Configuring and compiling GNU Libc</h2>
<a name="index-configuring"></a>
<a name="index-compiling"></a>

<p>GNU libc cannot be compiled in the source directory.  You must build
it in a separate build directory.  For example, if you have unpacked
the glibc sources in &lsquo;<tt>/src/gnu/glibc-2.4</tt>&rsquo;, create a directory
&lsquo;<tt>/src/gnu/glibc-build</tt>&rsquo; to put the object files in.  This allows
removing the whole build directory in case an error occurs, which is
the safest way to get a fresh start and should always be done.
</p>
<p>From your object directory, run the shell script &lsquo;<tt>configure</tt>&rsquo; located
at the top level of the source tree.  In the scenario above, you&rsquo;d type
</p>
<table><tr><td>&nbsp;</td><td><pre class="smallexample">$ ../glibc-2.4/configure <var>args&hellip;</var>
</pre></td></tr></table>

<p>Please note that even though you&rsquo;re building in a separate build
directory, the compilation needs to modify a few files in the source
directory, especially some files in the manual subdirectory.
</p>
<p><code>configure</code> takes many options, but the only one that is usually
mandatory is &lsquo;<samp>--prefix</samp>&rsquo;.  This option tells <code>configure</code>
where you want glibc installed.  This defaults to &lsquo;<tt>/usr/local</tt>&rsquo;,
but the normal setting to install as the standard system library is
&lsquo;<samp>--prefix=/usr</samp>&rsquo; for GNU/Linux systems and &lsquo;<samp>--prefix=</samp>&rsquo; (an
empty prefix) for GNU/Hurd systems.
</p>
<p>It may also be useful to set the <var>CC</var> and <var>CFLAGS</var> variables in
the environment when running <code>configure</code>.  <var>CC</var> selects the C
compiler that will be used, and <var>CFLAGS</var> sets optimization options
for the compiler.
</p>
<p>The following list describes all of the available options for
 <code>configure</code>:
</p>
<dl compact="compact">
<dt> &lsquo;<samp>--prefix=<var>directory</var></samp>&rsquo;</dt>
<dd><p>Install machine-independent data files in subdirectories of
&lsquo;<tt><var>directory</var></tt>&rsquo;.  The default is to install in &lsquo;<tt>/usr/local</tt>&rsquo;.
</p>
</dd>
<dt> &lsquo;<samp>--exec-prefix=<var>directory</var></samp>&rsquo;</dt>
<dd><p>Install the library and other machine-dependent files in subdirectories
of &lsquo;<tt><var>directory</var></tt>&rsquo;.  The default is to the &lsquo;<samp>--prefix</samp>&rsquo;
directory if that option is specified, or &lsquo;<tt>/usr/local</tt>&rsquo; otherwise.
</p>
</dd>
<dt> &lsquo;<samp>--with-headers=<var>directory</var></samp>&rsquo;</dt>
<dd><p>Look for kernel header files in <var>directory</var>, not
&lsquo;<tt>/usr/include</tt>&rsquo;.  Glibc needs information from the kernel&rsquo;s private
header files.  Glibc will normally look in &lsquo;<tt>/usr/include</tt>&rsquo; for them,
but if you specify this option, it will look in <var>DIRECTORY</var> instead.
</p>
<p>This option is primarily of use on a system where the headers in
&lsquo;<tt>/usr/include</tt>&rsquo; come from an older version of glibc.  Conflicts can
occasionally happen in this case.  Note that Linux libc5 qualifies as an
older version of glibc.  You can also use this option if you want to
compile glibc with a newer set of kernel headers than the ones found in
&lsquo;<tt>/usr/include</tt>&rsquo;.
</p>
</dd>
<dt> &lsquo;<samp>--enable-add-ons[=<var>list</var>]</samp>&rsquo;</dt>
<dd><p>Specify add-on packages to include in the build.  If this option is
specified with no list, it enables all the add-on packages it finds in
the main source directory; this is the default behavior.  You may
specify an explicit list of add-ons to use in <var>list</var>, separated by
spaces or commas (if you use spaces, remember to quote them from the
shell).  Each add-on in <var>list</var> can be an absolute directory name
or can be a directory name relative to the main source directory, or
relative to the build directory (that is, the current working directory).
For example, &lsquo;<samp>--enable-add-ons=nptl,../glibc-libidn-2.4</samp>&rsquo;.
</p>
</dd>
<dt> &lsquo;<samp>--enable-kernel=<var>version</var></samp>&rsquo;</dt>
<dd><p>This option is currently only useful on GNU/Linux systems.  The
<var>version</var> parameter should have the form X.Y.Z and describes the
smallest version of the Linux kernel the generated library is expected
to support.  The higher the <var>version</var> number is, the less
compatibility code is added, and the faster the code gets.
</p>
</dd>
<dt> &lsquo;<samp>--with-binutils=<var>directory</var></samp>&rsquo;</dt>
<dd><p>Use the binutils (assembler and linker) in &lsquo;<tt><var>directory</var></tt>&rsquo;, not
the ones the C compiler would default to.  You can use this option if
the default binutils on your system cannot deal with all the constructs
in the GNU C library.  In that case, <code>configure</code> will detect the
problem and suppress these constructs, so that the library will still be
usable, but functionality may be lost&mdash;for example, you can&rsquo;t build a
shared libc with old binutils.
</p>
</dd>
<dt> &lsquo;<samp>--without-fp</samp>&rsquo;</dt>
<dd><p>Use this option if your computer lacks hardware floating-point support
and your operating system does not emulate an FPU.
</p>
<p> these
</p>
</dd>
<dt> &lsquo;<samp>--disable-shared</samp>&rsquo;</dt>
<dd><p>Don&rsquo;t build shared libraries even if it is possible.  Not all systems
support shared libraries; you need ELF support and (currently) the GNU
linker.
</p>
</dd>
<dt> &lsquo;<samp>--disable-profile</samp>&rsquo;</dt>
<dd><p>Don&rsquo;t build libraries with profiling information.  You may want to use
this option if you don&rsquo;t plan to do profiling.
</p>
</dd>
<dt> &lsquo;<samp>--enable-omitfp</samp>&rsquo;</dt>
<dd><p>Use maximum optimization for the normal (static and shared)
libraries, and compile separate static libraries with debugging
information and no optimization.  We recommend not doing this.  The extra
optimization doesn&rsquo;t gain you much, it may provoke compiler bugs, and you
won&rsquo;t be able to trace bugs through the C library.
</p>
</dd>
<dt> &lsquo;<samp>--disable-versioning</samp>&rsquo;</dt>
<dd><p>Don&rsquo;t compile the shared libraries with symbol version information.
Doing this will make the resulting library incompatible with old
binaries, so it&rsquo;s not recommended.
</p>
</dd>
<dt> &lsquo;<samp>--enable-static-nss</samp>&rsquo;</dt>
<dd><p>Compile static versions of the NSS (Name Service Switch) libraries.
This is not recommended because it defeats the purpose of NSS; a program
linked statically with the NSS libraries cannot be dynamically
reconfigured to use a different name database.
</p>
</dd>
<dt> &lsquo;<samp>--without-tls</samp>&rsquo;</dt>
<dd><p>By default the C library is built with support for thread-local storage
if the used tools support it.  By using &lsquo;<samp>--without-tls</samp>&rsquo; this can be
prevented though there generally is no reason since it creates
compatibility problems.
</p>
</dd>
<dt> &lsquo;<samp>--build=<var>build-system</var></samp>&rsquo;</dt>
<dt> &lsquo;<samp>--host=<var>host-system</var></samp>&rsquo;</dt>
<dd><p>These options are for cross-compiling.  If you specify both options and
<var>build-system</var> is different from <var>host-system</var>, <code>configure</code>
will prepare to cross-compile glibc from <var>build-system</var> to be used
on <var>host-system</var>.  You&rsquo;ll probably need the &lsquo;<samp>--with-headers</samp>&rsquo;
option too, and you may have to override <var>configure</var>&rsquo;s selection of
the compiler and/or binutils.
</p>
<p>If you only specify &lsquo;<samp>--host</samp>&rsquo;, <code>configure</code> will prepare for a
native compile but use what you specify instead of guessing what your
system is. This is most useful to change the CPU submodel.  For example,
if <code>configure</code> guesses your machine as <code>i586-pc-linux-gnu</code> but
you want to compile a library for 386es, give
&lsquo;<samp>--host=i386-pc-linux-gnu</samp>&rsquo; or just &lsquo;<samp>--host=i386-linux</samp>&rsquo; and add
the appropriate compiler flags (&lsquo;<samp>-mcpu=i386</samp>&rsquo; will do the trick) to
<var>CFLAGS</var>.
</p>
<p>If you specify just &lsquo;<samp>--build</samp>&rsquo;, <code>configure</code> will get confused.
</p></dd>
</dl>

<p>To build the library and related programs, type <code>make</code>.  This will
produce a lot of output, some of which may look like errors from
<code>make</code> but isn&rsquo;t.  Look for error messages from <code>make</code>
containing &lsquo;<samp>***</samp>&rsquo;.  Those indicate that something is seriously wrong.
</p>
<p>The compilation process can take a long time, depending on the
configuration and the speed of your machine.  Some complex modules may
take a very long time to compile, as much as several minutes on slower
machines.  Do not panic if the compiler appears to hang.
</p>
<p>If you want to run a parallel make, simply pass the &lsquo;<samp>-j</samp>&rsquo; option
with an appropriate numeric parameter to <code>make</code>.  You need a recent
GNU <code>make</code> version, though.
</p>
<p>To build and run test programs which exercise some of the library
facilities, type <code>make check</code>.  If it does not complete
successfully, do not use the built library, and report a bug after
verifying that the problem is not already known.  See section <a href="#Reporting-Bugs">Reporting Bugs</a>,
for instructions on reporting bugs.  Note that some of the tests assume
they are not being run by <code>root</code>.  We recommend you compile and
test glibc as an unprivileged user.
</p>
<p>Before reporting bugs make sure there is no problem with your system.
The tests (and later installation) use some pre-existing files of the
system such as &lsquo;<tt>/etc/passwd</tt>&rsquo;, &lsquo;<tt>/etc/nsswitch.conf</tt>&rsquo; and others.
These files must all contain correct and sensible content.
</p>
<p>To format the <cite>GNU C Library Reference Manual</cite> for printing, type
<code>make dvi</code>.  You need a working TeX installation to do this.
The distribution already includes the on-line formatted version of the
manual, as Info files.  You can regenerate those with <code>make
info</code>, but it shouldn&rsquo;t be necessary.
</p>
<p>The library has a number of special-purpose configuration parameters
which you can find in &lsquo;<tt>Makeconfig</tt>&rsquo;.  These can be overwritten with
the file &lsquo;<tt>configparms</tt>&rsquo;.  To change them, create a
&lsquo;<tt>configparms</tt>&rsquo; in your build directory and add values as appropriate
for your system.  The file is included and parsed by <code>make</code> and has
to follow the conventions for makefiles.
</p>
<p>It is easy to configure the GNU C library for cross-compilation by
setting a few variables in &lsquo;<tt>configparms</tt>&rsquo;.  Set <code>CC</code> to the
cross-compiler for the target you configured the library for; it is
important to use this same <code>CC</code> value when running
<code>configure</code>, like this: &lsquo;<samp>CC=<var>target</var>-gcc configure
<var>target</var></samp>&rsquo;.  Set <code>BUILD_CC</code> to the compiler to use for programs
run on the build system as part of compiling the library.  You may need to
set <code>AR</code> to cross-compiling versions of <code>ar</code>
if the native tools are not configured to work with
object files for the target you configured for.
</p>

<hr size="6">
<a name="Running-make-install"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Configuring-and-compiling" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Tools-for-Compilation" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Installation" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Installation" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="libc_37.html#Maintenance" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="libc.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="libc_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="libc_42.html#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="libc_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Installing-the-C-Library"></a>
<h2 class="appendixsec">C.2 Installing the C Library</h2>
<a name="index-installing"></a>

<p>To install the library and its header files, and the Info files of the
manual, type <code>env LANGUAGE=C LC_ALL=C make install</code>.  This will
build things, if necessary, before installing them; however, you should
still compile everything first.  If you are installing glibc as your
primary C library, we recommend that you shut the system down to
single-user mode first, and reboot afterward.  This minimizes the risk
of breaking things when the library changes out from underneath.
</p>
<p>If you&rsquo;re upgrading from Linux libc5 or some other C library, you need to
replace the &lsquo;<tt>/usr/include</tt>&rsquo; with a fresh directory before installing
it.  The new &lsquo;<tt>/usr/include</tt>&rsquo; should contain the Linux headers, but
nothing else.
</p>
<p>You must first build the library (&lsquo;<samp>make</samp>&rsquo;), optionally check it
(&lsquo;<samp>make check</samp>&rsquo;), switch the include directories and then install
(&lsquo;<samp>make install</samp>&rsquo;).  The steps must be done in this order.  Not moving
the directory before install will result in an unusable mixture of header
files from both libraries, but configuring, building, and checking the
library requires the ability to compile and run programs against the old
library.
</p>
<p>If you are upgrading from a previous installation of glibc 2.0 or 2.1,
&lsquo;<samp>make install</samp>&rsquo; will do the entire job.  You do not need to remove
the old includes &ndash; if you want to do so anyway you must then follow the
order given above.
</p>
<p>You may also need to reconfigure GCC to work with the new library.  The
easiest way to do that is to figure out the compiler switches to make it
work again (&lsquo;<samp>-Wl,--dynamic-linker=/lib/ld-linux.so.2</samp>&rsquo; should work on
GNU/Linux systems) and use them to recompile gcc.  You can also edit the specs
file (&lsquo;<tt>/usr/lib/gcc-lib/<var>TARGET</var>/<var>VERSION</var>/specs</tt>&rsquo;), but that
is a bit of a black art.
</p>
<p>You can install glibc somewhere other than where you configured it to go
by setting the <code>install_root</code> variable on the command line for
&lsquo;<samp>make install</samp>&rsquo;.  The value of this variable is prepended to all the
paths for installation.  This is useful when setting up a chroot
environment or preparing a binary distribution.  The directory should be
specified with an absolute file name.
</p>
<p>Glibc 2.2 includes a daemon called <code>nscd</code>, which you
may or may not want to run.  <code>nscd</code> caches name service lookups; it
can dramatically improve performance with NIS+, and may help with DNS as
well.
</p>
<p>One auxiliary program, &lsquo;<tt>/usr/libexec/pt_chown</tt>&rsquo;, is installed setuid
<code>root</code>.  This program is invoked by the <code>grantpt</code> function; it
sets the permissions on a pseudoterminal so it can be used by the
calling process.  This means programs like <code>xterm</code> and
<code>screen</code> do not have to be setuid to get a pty.  (There may be
other reasons why they need privileges.)  If you are using a 2.1 or
newer Linux kernel with the <code>devptsfs</code> or <code>devfs</code> filesystems
providing pty slaves, you don&rsquo;t need this program; otherwise you do.
The source for &lsquo;<tt>pt_chown</tt>&rsquo; is in &lsquo;<tt>login/programs/pt_chown.c</tt>&rsquo;.
</p>
<p>After installation you might want to configure the timezone and locale
installation of your system.  The GNU C library comes with a locale
database which gets configured with <code>localedef</code>.  For example, to
set up a German locale with name <code>de_DE</code>, simply issue the command
&lsquo;<samp>localedef -i de_DE -f ISO-8859-1 de_DE</samp>&rsquo;.  To configure all locales
that are supported by glibc, you can issue from your build directory the
command &lsquo;<samp>make localedata/install-locales</samp>&rsquo;.
</p>
<p>To configure the locally used timezone, set the <code>TZ</code> environment
variable.  The script <code>tzselect</code> helps you to select the right value.
As an example, for Germany, <code>tzselect</code> would tell you to use
&lsquo;<samp>TZ='Europe/Berlin'</samp>&rsquo;.  For a system wide installation (the given
paths are for an installation with &lsquo;<samp>--prefix=/usr</samp>&rsquo;), link the
timezone file which is in &lsquo;<tt>/usr/share/zoneinfo</tt>&rsquo; to the file
&lsquo;<tt>/etc/localtime</tt>&rsquo;.  For Germany, you might execute &lsquo;<samp>ln -s
/usr/share/zoneinfo/Europe/Berlin /etc/localtime</samp>&rsquo;.
</p>
<hr size="6">
<a name="Tools-for-Compilation"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Running-make-install" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Linux" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Installation" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Installation" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="libc_37.html#Maintenance" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="libc.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="libc_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="libc_42.html#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="libc_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Recommended-Tools-for-Compilation"></a>
<h2 class="appendixsec">C.3 Recommended Tools for Compilation</h2>
<a name="index-installation-tools"></a>
<a name="index-tools_002c-for-installing-library"></a>

<p>We recommend installing the following GNU tools before attempting to
build the GNU C library:
</p>
<ul>
<li>
GNU <code>make</code> 3.79 or newer

<p>You need the latest version of GNU <code>make</code>.  Modifying the GNU C
Library to work with other <code>make</code> programs would be so difficult that
we recommend you port GNU <code>make</code> instead.  <strong>Really.</strong>  We
recommend GNU <code>make</code> version 3.79.  All earlier versions have severe
bugs or lack features.
</p>
</li><li>
GCC 3.4 or newer, GCC 4.1 recommended

<p>For the 2.4 release or later, GCC 3.4 or higher is required; as of this
writing, GCC 4.4 is the compiler we advise to use for current versions.
On certain machines including <code>powerpc64</code>, compilers prior to GCC
4.0 have bugs that prevent them compiling the C library code in the
2.4 release.  On other machines, GCC 4.1 is required to build the C
library with support for the correct <code>long double</code> type format;
these include <code>powerpc</code> (32 bit), <code>s390</code> and <code>s390x</code>.  For
other architectures special compiler-provided headers are needed
(like &lsquo;<tt>cpuid.h</tt>&rsquo; on x86) which only come with later compiler versions.
</p>
<p>You can use whatever compiler you like to compile programs that use GNU
libc, but be aware that both GCC 2.7 and 2.8 have bugs in their
floating-point support that may be triggered by the math library.
</p>
<p>Check the FAQ for any special compiler issues on particular platforms.
</p>
</li><li>
GNU <code>binutils</code> 2.15 or later

<p>You must use GNU <code>binutils</code> (as and ld) to build the GNU C library.
No other assembler or linker has the necessary functionality at the
moment.
</p>
</li><li>
GNU <code>texinfo</code> 3.12f

<p>To correctly translate and install the Texinfo documentation you need
this version of the <code>texinfo</code> package.  Earlier versions do not
understand all the tags used in the document, and the installation
mechanism for the info files is not present or works differently.
</p>
</li><li>
GNU <code>awk</code> 3.0, or higher

<p><code>Awk</code> is used in several places to generate files.
<code>gawk</code> 3.0 is known to work.
</p>
</li><li>
Perl 5

<p>Perl is not required, but it is used if present to test the
installation.  We may decide to use it elsewhere in the future.
</p>
</li><li>
GNU <code>sed</code> 3.02 or newer

<p><code>Sed</code> is used in several places to generate files.  Most scripts work
with any version of <code>sed</code>.  The known exception is the script
<code>po2test.sed</code> in the <code>intl</code> subdirectory which is used to
generate <code>msgs.h</code> for the test suite.  This script works correctly
only with GNU <code>sed</code> 3.02.  If you like to run the test suite, you
should definitely upgrade <code>sed</code>.
</p>
</li></ul>

<p>If you change any of the &lsquo;<tt>configure.in</tt>&rsquo; files you will also need
</p>
<ul>
<li>
GNU <code>autoconf</code> 2.53 or higher
</li></ul>

<p>and if you change any of the message translation files you will need
</p>
<ul>
<li>
GNU <code>gettext</code> 0.10.36 or later
</li></ul>

<p>You may also need these packages if you upgrade your source tree using
patches, although we try to avoid this.
</p>
<hr size="6">
<a name="Linux"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Tools-for-Compilation" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Reporting-Bugs" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Installation" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Installation" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="libc_37.html#Maintenance" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="libc.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="libc_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="libc_42.html#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="libc_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Specific-advice-for-GNU_002fLinux-systems"></a>
<h2 class="appendixsec">C.4 Specific advice for GNU/Linux systems</h2>
<a name="index-upgrading-from-libc5"></a>
<a name="index-kernel-header-files"></a>

<p>If you are installing GNU libc on a GNU/Linux system, you need to have the
header files from a 2.2 or newer kernel around for reference.  For some
architectures, like ia64, sh and hppa, you need at least headers from
kernel 2.3.99 (sh and hppa) or 2.4.0 (ia64).  You do not need to use
that kernel, just have its headers where glibc can access at them.  The
easiest way to do this is to unpack it in a directory such as
&lsquo;<tt>/usr/src/linux-2.2.1</tt>&rsquo;.  In that directory, run &lsquo;<samp>make config</samp>&rsquo;
and accept all the defaults.  Then run &lsquo;<samp>make
include/linux/version.h</samp>&rsquo;.  Finally, configure glibc with the option
&lsquo;<samp>--with-headers=/usr/src/linux-2.2.1/include</samp>&rsquo;.  Use the most recent
kernel you can get your hands on.
</p>
<p>An alternate tactic is to unpack the 2.2 kernel and run &lsquo;<samp>make
config</samp>&rsquo; as above; then, rename or delete &lsquo;<tt>/usr/include</tt>&rsquo;, create a
new &lsquo;<tt>/usr/include</tt>&rsquo;, and make symbolic links of
&lsquo;<tt>/usr/include/linux</tt>&rsquo; and &lsquo;<tt>/usr/include/asm</tt>&rsquo; into the kernel
sources.  You can then configure glibc with no special options.  This
tactic is recommended if you are upgrading from libc5, since you need to
get rid of the old header files anyway.
</p>
<p>After installing GNU libc, you may need to remove or rename
&lsquo;<tt>/usr/include/linux</tt>&rsquo; and &lsquo;<tt>/usr/include/asm</tt>&rsquo;, and replace them
with copies of &lsquo;<tt>include/linux</tt>&rsquo; and
&lsquo;<tt>include/asm-$<var>ARCHITECTURE</var></tt>&rsquo; taken from the Linux source
package which supplied kernel headers for building the library.
<var>ARCHITECTURE</var> will be the machine architecture for which the
library was built, such as &lsquo;<samp>i386</samp>&rsquo; or &lsquo;<samp>alpha</samp>&rsquo;.  You do not need
to do this if you did not specify an alternate kernel header source
using &lsquo;<samp>--with-headers</samp>&rsquo;.  The intent here is that these directories
should be copies of, <strong>not</strong> symlinks to, the kernel headers used to
build the library.
</p>
<p>Note that &lsquo;<tt>/usr/include/net</tt>&rsquo; and &lsquo;<tt>/usr/include/scsi</tt>&rsquo; should
<strong>not</strong> be symlinks into the kernel sources.  GNU libc provides its
own versions of these files.
</p>
<p>GNU/Linux expects some components of the libc installation to be in
&lsquo;<tt>/lib</tt>&rsquo; and some in &lsquo;<tt>/usr/lib</tt>&rsquo;.  This is handled automatically
if you configure glibc with &lsquo;<samp>--prefix=/usr</samp>&rsquo;.  If you set some other
prefix or allow it to default to &lsquo;<tt>/usr/local</tt>&rsquo;, then all the
components are installed there.
</p>
<p>If you are upgrading from libc5, you need to recompile every shared
library on your system against the new library for the sake of new code,
but keep the old libraries around for old binaries to use.  This is
complicated and difficult.  Consult the Glibc2 HOWTO at
<a href="http://www.imaxx.net/~thrytis/glibc">http://www.imaxx.net/~thrytis/glibc</a> for details.
</p>
<p>You cannot use <code>nscd</code> with 2.0 kernels, due to bugs in the
kernel-side thread support.  <code>nscd</code> happens to hit these bugs
particularly hard, but you might have problems with any threaded
program.
</p>
<hr size="6">
<a name="Reporting-Bugs"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Linux" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="libc_37.html#Maintenance" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Installation" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Installation" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="libc_37.html#Maintenance" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="libc.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="libc_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="libc_42.html#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="libc_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Reporting-Bugs-1"></a>
<h2 class="appendixsec">C.5 Reporting Bugs</h2>
<a name="index-reporting-bugs"></a>
<a name="index-bugs_002c-reporting"></a>

<p>There are probably bugs in the GNU C library.  There are certainly
errors and omissions in this manual.  If you report them, they will get
fixed.  If you don&rsquo;t, no one will ever know about them and they will
remain unfixed for all eternity, if not longer.
</p>
<p>It is a good idea to verify that the problem has not already been
reported.  Bugs are documented in two places: The file &lsquo;<tt>BUGS</tt>&rsquo;
describes a number of well known bugs and the upstream GNU C library
bug tracking system has a
WWW interface at
<a href="http://sources.redhat.com/bugzilla/">http://sources.redhat.com/bugzilla/</a>.  The WWW
interface gives you access to open and closed reports.  A closed report
normally includes a patch or a hint on solving the problem.
</p>
<p>To report a bug, first you must find it.  With any luck, this will be the
hard part.  Once you&rsquo;ve found a bug, make sure it&rsquo;s really a bug.  A
good way to do this is to see if the GNU C library behaves the same way
some other C library does.  If so, probably you are wrong and the
libraries are right (but not necessarily).  If not, one of the libraries
is probably wrong.  It might not be the GNU library.  Many historical
Unix C libraries permit things that we don&rsquo;t, such as closing a file
twice.
</p>
<p>If you think you have found some way in which the GNU C library does not
conform to the ISO and POSIX standards (see section <a href="libc_1.html#Standards-and-Portability">Standards and Portability</a>), that is definitely a bug.  Report it!
</p>
<p>Once you&rsquo;re sure you&rsquo;ve found a bug, try to narrow it down to the
smallest test case that reproduces the problem.  In the case of a C
library, you really only need to narrow it down to one library
function call, if possible.  This should not be too difficult.
</p>
<p>The final step when you have a simple test case is to report the bug.
Do this at <a href="http://www.debian.org/Bugs/">http://www.debian.org/Bugs/</a>.
</p>
<p>If you are not sure how a function should behave, and this manual
doesn&rsquo;t tell you, that&rsquo;s a bug in the manual.  Report that too!  If the
function&rsquo;s behavior disagrees with the manual, then either the library
or the manual has a bug, so report the disagreement.  If you find any
errors or omissions in this manual, please report them to the
bug database.  If you refer to specific
sections of the manual, please include the section names for easier
identification.
</p><hr size="6">
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Installation" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="libc_37.html#Maintenance" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="libc.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="libc_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="libc_42.html#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="libc_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<p>
 <font size="-1">
  This document was generated by <em>root</em> on <em>April 20, 2012</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.82</em></a>.
 </font>
 <br>

</p>
</body>
</html>