Changeset ef13657 for chapter06/glibc.xml
- Timestamp:
- 08/08/2004 02:11:09 AM (20 years ago)
- Branches:
- 6.0
- Children:
- 5ba3d1d
- Parents:
- 6e41459
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter06/glibc.xml
r6e41459 ref13657 32 32 <title>Installation of Glibc</title> 33 33 34 <para>The Glibc build system is very well self-contained and will install 35 perfectly, even though our compiler specs file and linker are still pointing 36 at <filename class="directory">/tools</filename>. We cannot adjust the specs and linker before 37 the Glibc install, because the Glibc autoconf tests would then give bogus 38 results and thus defeat our goal of achieving a clean build.</para> 39 40 <para>Before starting to build Glibc, remember to unset any environment 41 variables that override the default optimization flags.</para> 34 <para>The Glibc build system is self-contained and will install 35 perfectly, even though the compiler specs file and linker are still 36 pointing at <filename class="directory">/tools</filename>. The specs 37 and linker cannot be adjusted before the Glibc install because the 38 Glibc autoconf tests would then give false results and defeat the goal 39 of achieving a clean build.</para> 40 41 <para>Before starting to build Glibc, remember to unset any 42 environment variables that override the default optimization 43 flags.</para> 42 44 43 45 <para>The Glibc documentation recommends building Glibc outside of the source … … 52 54 --disable-profile --enable-add-ons=nptl --with-tls \ 53 55 --with-__thread --enable-kernel=2.6.0 --without-cvs \ 56 --libexecdir=/usr/lib/glibc \ 54 57 --with-headers=/tools/glibc-kernheaders</userinput></screen> 55 58 59 <para>The meaning of the new configure option:</para> 60 61 <variablelist> 62 <varlistentry> 63 <term><parameter>--libexecdir=/usr/lib/glibc</parameter></term> 64 <listitem><para>This changes the location of the 65 <command>pt_chown</command> program from its default of <filename 66 class="directory">/usr/libexec</filename> to <filename 67 class="directory">/usr/lib/glibc</filename>.</para></listitem> 68 </varlistentry> 69 </variablelist> 70 56 71 <para>Compile the package:</para> 57 72 58 73 <screen><userinput>make</userinput></screen> 59 74 60 <important><para> The test suite for Glibc in this section is considered61 <emphasis>critical</emphasis>. Our advice is to not skip it under any75 <important><para>In this section, the test suite for Glibc is 76 considered critical. Do not skip it under any 62 77 circumstance.</para></important> 63 78 … … 66 81 <screen><userinput>make check</userinput></screen> 67 82 68 <para>The Glibc test suite is highly dependent on certain functions of your host 69 system, in particular the kernel. In general, the Glibc test suite is always 70 expected to pass. However, in certain circumstances some failures are 71 unavoidable. Here is a list of the most common issues we are aware of:</para> 83 <para>The Glibc test suite is highly dependent on certain functions of 84 the host system, in particular the kernel. In general, the Glibc test 85 suite is always expected to pass. However, in certain circumstances, 86 some failures are unavoidable. This is a list of the most common 87 issues:</para> 72 88 73 89 <itemizedlist> … … 79 95 host system issues. The exact reasons are not yet clear.</para></listitem> 80 96 81 <listitem><para>The <emphasis>atime</emphasis> test sometimes fails when the 82 LFS partition is mounted with the <parameter>noatime</parameter> option, or due 83 to other file system quirks.</para></listitem> 84 85 <listitem><para>The <emphasis>shm</emphasis> test might fail when the host 86 system is running the devfs file system but doesn't have the <systemitem class="filesystem">tmpfs</systemitem> file system 87 mounted at <filename class="directory">/dev/shm</filename> due to lack of support for tmpfs in 88 the kernel.</para></listitem> 89 90 <listitem><para>When running on older and slower hardware, some tests might 91 fail due to test timeouts being exceeded.</para></listitem> 97 <listitem><para>The <emphasis>atime</emphasis> test sometimes fails 98 when the LFS partition is mounted with the 99 <parameter>noatime</parameter> option. This sometimes occurs because 100 of other file system quirks as well.</para></listitem> 101 102 <listitem><para>The <emphasis>shm</emphasis> test can fail when the 103 host system is using the <systemitem 104 class="filesystem">devfs</systemitem> file system but does not have 105 the <systemitem class="filesystem">tmpfs</systemitem> file system 106 mounted at <filename class="directory">/dev/shm</filename>. This 107 occurs because of a lack of support for tmpfs in the 108 kernel.</para></listitem> 109 110 <listitem><para>When running on older and slower hardware, some tests 111 can fail because of test timeouts being exceeded.</para></listitem> 92 112 </itemizedlist> 93 113 94 114 <para>Though it is a harmless message, the install stage of Glibc will 95 complain about the absence of <filename>/etc/ld.so.conf</filename>. Fix this96 annoying littlewarning with:</para>115 complain about the absence of <filename>/etc/ld.so.conf</filename>. 116 Prevent this warning with:</para> 97 117 98 118 <screen><userinput>touch /etc/ld.so.conf</userinput></screen> 99 119 100 <para> And install the package:</para>120 <para>Install the package:</para> 101 121 102 122 <screen><userinput>make install</userinput></screen> 103 123 104 <para>The locales that can make your system respond in a different language 105 weren't installed by the above command. Do it with this:</para> 124 <para>The locales that can make the system respond in a different 125 language were not installed by the above command. Install this 126 with:</para> 106 127 107 128 <screen><userinput>make localedata/install-locales</userinput></screen> 108 129 109 <para>An alternative to running the previous command is to install only those 110 locales which you need or want. This can be achieved by using the 111 <command>localedef</command> command. Information on this can be found in 112 the <filename>INSTALL</filename> file in the Glibc source. However, there are 113 a number of locales that are essential for the tests of future packages to 114 pass, in particular, the <emphasis>libstdc++</emphasis> tests from GCC. The 115 following instructions, instead of the install-locales target above, will 116 install the minimum set of locales necessary for the tests to run 117 successfully:</para> 130 <para>To save yourself a lot of time, an alternative to running the 131 previous command (which generates and installs every locale Glibc is 132 aware of) is to install only those locales that are wanted and needed. 133 This can be achieved by using the <command>localedef</command> 134 command. Information on this command is located in the 135 <filename>INSTALL</filename> file in the Glibc source. However, there 136 are a number of locales that are essential in order for the tests of 137 future packages to pass, in particular, the 138 <emphasis>libstdc++</emphasis> tests from GCC. The following 139 instructions, instead of the <emphasis>install-locales</emphasis> 140 target used above, will install the minimum set of locales necessary 141 for the tests to run successfully:</para> 118 142 119 143 <screen><userinput>mkdir -p /usr/lib/locale … … 130 154 localedef -i ja_JP -f EUC-JP ja_JP</userinput></screen> 131 155 132 <para>In fact, some locales installed by the 133 <command>make localedata/install-locales</command> 134 command above are not properly 135 supported by some applications that are in LFS and BLFS books. Because 136 of various problems that arise 137 due to application programmers making 138 assumptions that break in such locales, LFS <emphasis>should not</emphasis> 139 be used in locales that utilize 140 multibyte character sets (including UTF-8) or 141 right-to-left writing order. 142 Numerous unofficial and unstable patches are required to fix these problems, 143 and it has been decided not to support such complex locales. 144 This applies to the ja_JP and fa_IR locales as well: 145 they have been installed only 146 for GCC and Gettext tests to pass, and e.g. 147 the <command>watch</command> program (part of Procps) 148 compiled according to this book doesn't work properly in them. 149 Various attempts to circumvent these 150 restrictions are documented in internationalization-related hints.</para> 151 152 <para>Finally, build the linuxthreads man pages, which are a great reference 156 <para>Some locales installed by the <command>make 157 localedata/install-locales</command> command above are not properly 158 supported by some applications that are in the LFS and BLFS books. 159 Because of the various problems that arise due to application 160 programmers making assumptions that break in such locales, LFS should 161 not be used in locales that utilize multibyte character sets 162 (including UTF-8) or right-to-left writing order. Numerous unofficial 163 and unstable patches are required to fix these problems, and it has 164 been decided not to support such complex locales. This applies to the 165 ja_JP and fa_IR locales as well -- they have been installed only for 166 GCC and Gettext tests to pass and the <command>watch</command> program 167 (part of the Procps package) does not work properly in them. Various 168 attempts to circumvent these restrictions are documented in 169 internationalization-related hints.</para> 170 171 <para>Build the linuxthreads man pages, which are a great reference 153 172 on the threading API (applicable to NPTL as well):</para> 154 173 155 174 <screen><userinput>make -C ../glibc-&glibc-version;/linuxthreads/man</userinput></screen> 156 175 157 <para> And install these pages:</para>176 <para>Install these pages:</para> 158 177 159 178 <screen><userinput>make -C ../glibc-&glibc-version;/linuxthreads/man install</userinput></screen> 160 179 161 180 </sect2> 162 163 181 164 182 <sect2 id="conf-glibc" role="configuration"><title>Configuring Glibc</title> … … 166 184 <indexterm zone="conf-glibc"><primary sortas="e-/etc/localtime">/etc/localtime</primary></indexterm> 167 185 168 <para> We need to create the <filename>/etc/nsswitch.conf</filename> file,169 because, although Glibc provides defaults when this file is missing or corrupt, 170 the Glibc defaults don't work well with networking. Also, our time zone needs 171 to be set up.</para>186 <para>The <filename>/etc/nsswitch.conf</filename> file needs to be 187 created because, although Glibc provides defaults when this file is 188 missing or corrupt, the Glibc defaults do not work well with 189 networking. The time zone also needs to be set up.</para> 172 190 173 191 <para>Create a new file <filename>/etc/nsswitch.conf</filename> by running the … … 196 214 <screen><userinput>tzselect</userinput></screen> 197 215 198 <para>When you've answered a few questions about your location, the script will 199 output the name of your time zone, something like <emphasis>EST5EDT</emphasis> 200 or <emphasis>Canada/Eastern</emphasis>. Then create the 201 <filename>/etc/localtime</filename> file by running:</para> 202 203 <screen><userinput>cp --remove-destination /usr/share/zoneinfo/Canada/Eastern /etc/localtime</userinput></screen> 204 205 <para>The meaning of the option:</para> 216 <para>After answering a few questions about the location, the script 217 will output the name of the time zone (e.g., 218 <emphasis>EST5EDT</emphasis> or <emphasis>Canada/Eastern</emphasis>). 219 Then create the <filename>/etc/localtime</filename> file by 220 running:</para> 221 222 <screen><userinput>cp --remove-destination /usr/share/zoneinfo/<replaceable>[xxx]</replaceable> /etc/localtime</userinput></screen> 223 224 <para>Replace [xxx] with the name of the time zone that the 225 <command>tzselect</command> provided (e.g., Canada/Eastern).</para> 226 227 <para>The meaning of the cp option:</para> 206 228 207 229 <variablelist> 208 230 <varlistentry> 209 231 <term><parameter>--remove-destination</parameter></term> 210 <listitem><para>This is needed to force removal of the already existing symbolic 211 link. The reason why we copy instead of symlink is to cover the situation where 212 <filename class="directory">/usr</filename> is on a separate partition. This could matter, for 213 example, when booted into single user mode.</para></listitem> 232 <listitem><para>This is needed to force removal of the already 233 existing symbolic link. The reason for copying the file instead of 234 using a symlink is to cover the situation where <filename 235 class="directory">/usr</filename> is on a separate partition. This 236 could be important when booted into single user 237 mode.</para></listitem> 214 238 </varlistentry> 215 239 </variablelist> 216 217 <para>Of course, instead of <emphasis>Canada/Eastern</emphasis>, fill in218 the name of the time zone that the <command>tzselect</command> script219 gave you.</para>220 240 221 241 </sect2> … … 226 246 <indexterm zone="conf-ld"><primary sortas="e-/etc/ld.so.conf">/etc/ld.so.conf</primary></indexterm> 227 247 228 <para>By default, the dynamic loader 229 (<filename class="libraryfile">/lib/ld-linux.so.2</filename>) searches through <filename 230 class="directory">/lib</filename> and <filename class="directory">/usr/lib</filename> 231 for dynamic libraries that are needed 232 by programs when you run them. However, if there are libraries in248 <para>By default, the dynamic loader (<filename 249 class="libraryfile">/lib/ld-linux.so.2</filename>) searches through 250 <filename class="directory">/lib</filename> and <filename 251 class="directory">/usr/lib</filename> for dynamic libraries that are 252 needed by programs as they are run. However, if there are libraries in 233 253 directories other than <filename class="directory">/lib</filename> and 234 <filename class="directory">/usr/lib</filename>, you need to add them to 235 the <filename>/etc/ld.so.conf</filename> file for the dynamic 236 loader to find them. Two directories that are commonly known to contain 237 additional libraries are <filename class="directory">/usr/local/lib</filename> 238 and <filename class="directory">/opt/lib</filename>, so we add those directories to the 254 <filename class="directory">/usr/lib</filename>, these need to be 255 added them to the <filename>/etc/ld.so.conf</filename> file in order 256 for the dynamic loader to find them. Two directories that are commonly 257 known to contain additional libraries are <filename 258 class="directory">/usr/local/lib</filename> and <filename 259 class="directory">/opt/lib</filename>, so add those directories to the 239 260 dynamic loader's search path.</para> 240 261 … … 278 299 <listitem> 279 300 <indexterm zone="ch-system-glibc catchsegv"><primary sortas="b-catchsegv">catchsegv</primary></indexterm> 280 <para>can be used to create a stack trace 281 when a programterminates with a segmentation fault.</para>301 <para>can be used to create a stack trace when a program 302 terminates with a segmentation fault.</para> 282 303 </listitem> 283 304 </varlistentry> … … 327 348 <listitem> 328 349 <indexterm zone="ch-system-glibc iconvconfig"><primary sortas="b-iconvconfig">iconvconfig</primary></indexterm> 329 <para>creates fastloading <command>iconv</command> module configuration file .</para>350 <para>creates fastloading <command>iconv</command> module configuration files.</para> 330 351 </listitem> 331 352 </varlistentry> … … 360 381 <listitem> 361 382 <indexterm zone="ch-system-glibc locale"><primary sortas="b-locale">locale</primary></indexterm> 362 <para> isa Perl program that tells the compiler383 <para>a Perl program that tells the compiler 363 384 to enable or disable the use of POSIX locales for built-in operations.</para> 364 385 </listitem> … … 377 398 <listitem> 378 399 <indexterm zone="ch-system-glibc mtrace"><primary sortas="b-mtrace">mtrace</primary></indexterm> 379 <para>...</para> 400 <para>a program that reads and interprets a memory trace file and 401 ouputs a summary in human-readable format.</para> 380 402 </listitem> 381 403 </varlistentry> … … 385 407 <listitem> 386 408 <indexterm zone="ch-system-glibc nscd"><primary sortas="b-nscd">nscd</primary></indexterm> 387 <para> is a name service cache daemon providing a388 cache for the most common nameservice requests.</para>409 <para>a daemon that provides a cache for the most common name 410 service requests.</para> 389 411 </listitem> 390 412 </varlistentry> … … 410 432 <listitem> 411 433 <indexterm zone="ch-system-glibc pt_chown"><primary sortas="b-pt_chown">pt_chown</primary></indexterm> 412 <para>is a helper program for grantptto set434 <para>is a helper program for <command>grantpt</command> to set 413 435 the owner, group and access permissions of a slave pseudo terminal.</para> 414 436 </listitem> … … 419 441 <listitem> 420 442 <indexterm zone="ch-system-glibc rpcgen"><primary sortas="b-rpcgen">rpcgen</primary></indexterm> 421 <para>generates C code to implement the R PCprotocol.</para>443 <para>generates C code to implement the Remote Procecure call (RPC) protocol.</para> 422 444 </listitem> 423 445 </varlistentry> … … 435 457 <listitem> 436 458 <indexterm zone="ch-system-glibc sln"><primary sortas="b-sln">sln</primary></indexterm> 437 <para>is used to make symbolic links. The program 438 is statically linked, so it is useful for making symbolic links to dynamic 439 libraries if the dynamic linking system for some reason is nonfunctional.</para> 459 <para>a statically linked <command>ln</command> program.</para> 440 460 </listitem> 441 461 </varlistentry> … … 471 491 <listitem> 472 492 <indexterm zone="ch-system-glibc zdump"><primary sortas="b-zdump">zdump</primary></indexterm> 473 <para> isthe time zone dumper.</para>493 <para>the time zone dumper.</para> 474 494 </listitem> 475 495 </varlistentry> … … 479 499 <listitem> 480 500 <indexterm zone="ch-system-glibc zic"><primary sortas="b-zic">zic</primary></indexterm> 481 <para> isthe time zone compiler.</para>501 <para>the time zone compiler.</para> 482 502 </listitem> 483 503 </varlistentry> … … 487 507 <listitem> 488 508 <indexterm zone="ch-system-glibc ld.so"><primary sortas="c-ld.so">ld.so</primary></indexterm> 489 <para> isthe helper program for shared library executables.</para>509 <para>the helper program for shared library executables.</para> 490 510 </listitem> 491 511 </varlistentry> … … 495 515 <listitem> 496 516 <indexterm zone="ch-system-glibc libBrokenLocale"><primary sortas="c-libBrokenLocale">libBrokenLocale</primary></indexterm> 497 <para> isused by programs, such as Mozilla, to solve broken locales.</para>517 <para>used by programs, such as Mozilla, to solve broken locales.</para> 498 518 </listitem> 499 519 </varlistentry> … … 503 523 <listitem> 504 524 <indexterm zone="ch-system-glibc libSegFault"><primary sortas="c-libSegFault">libSegFault</primary></indexterm> 505 <para> is a segmentation fault signal handler. It tries to catch segfaults.</para>525 <para>the segmentation fault signal handler.</para> 506 526 </listitem> 507 527 </varlistentry> … … 511 531 <listitem> 512 532 <indexterm zone="ch-system-glibc libanl"><primary sortas="c-libanl">libanl</primary></indexterm> 513 <para> isan asynchronous name lookup library.</para>533 <para>an asynchronous name lookup library.</para> 514 534 </listitem> 515 535 </varlistentry> … … 528 548 <listitem> 529 549 <indexterm zone="ch-system-glibc libc"><primary sortas="c-libc">libc</primary></indexterm> 530 <para> is the main C library -- a collection of commonly used functions.</para>550 <para>the main C library.</para> 531 551 </listitem> 532 552 </varlistentry> … … 536 556 <listitem> 537 557 <indexterm zone="ch-system-glibc libcrypt"><primary sortas="c-libcrypt">libcrypt</primary></indexterm> 538 <para> isthe cryptography library.</para>558 <para>the cryptography library.</para> 539 559 </listitem> 540 560 </varlistentry> … … 544 564 <listitem> 545 565 <indexterm zone="ch-system-glibc libdl"><primary sortas="c-libdl">libdl</primary></indexterm> 546 <para> isthe dynamic linking interface library.</para>566 <para>the dynamic linking interface library.</para> 547 567 </listitem> 548 568 </varlistentry> … … 552 572 <listitem> 553 573 <indexterm zone="ch-system-glibc libg"><primary sortas="c-libg">libg</primary></indexterm> 554 <para> isa runtime library for <command>g++</command>.</para>574 <para>a runtime library for <command>g++</command>.</para> 555 575 </listitem> 556 576 </varlistentry> … … 560 580 <listitem> 561 581 <indexterm zone="ch-system-glibc libieee"><primary sortas="c-libieee">libieee</primary></indexterm> 562 <para> is the IEEEfloating point library.</para>582 <para>the Institute of Electrical and Electronic Engineers (IEEE) floating point library.</para> 563 583 </listitem> 564 584 </varlistentry> … … 568 588 <listitem> 569 589 <indexterm zone="ch-system-glibc libm"><primary sortas="c-libm">libm</primary></indexterm> 570 <para> isthe mathematical library.</para>590 <para>the mathematical library.</para> 571 591 </listitem> 572 592 </varlistentry> … … 584 604 <listitem> 585 605 <indexterm zone="ch-system-glibc libmemusage"><primary sortas="c-libmemusage">libmemusage</primary></indexterm> 586 <para> isused by <command>memusage</command> to help collect606 <para>used by <command>memusage</command> to help collect 587 607 information about the memory usage of a program.</para> 588 608 </listitem> … … 593 613 <listitem> 594 614 <indexterm zone="ch-system-glibc libnsl"><primary sortas="c-libnsl">libnsl</primary></indexterm> 595 <para> isthe network services library.</para>615 <para>the network services library.</para> 596 616 </listitem> 597 617 </varlistentry> … … 601 621 <listitem> 602 622 <indexterm zone="ch-system-glibc libnss"><primary sortas="c-libnss*">libnss*</primary></indexterm> 603 <para> arethe Name Service Switch libraries,623 <para>the Name Service Switch libraries, 604 624 containing functions for resolving host names, user names, group names, 605 aliases, services, protocols, and the like.</para>625 aliases, services, protocols, etc.</para> 606 626 </listitem> 607 627 </varlistentry> … … 671 691 672 692 </sect1> 693
Note:
See TracChangeset
for help on using the changeset viewer.