source: chapter08/glibc.xml@ 5365c7a

xry111/mips64el
Last change on this file since 5365c7a was 5365c7a, checked in by Xi Ruoyao <xry111@…>, 2 weeks ago

Merge remote-tracking branch 'origin/trunk' into xry111/mips64el

  • Property mode set to 100644
File size: 41.7 KB
RevLine 
[7152faa]1<?xml version="1.0" encoding="UTF-8"?>
[fcc02767]2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../general.ent">
5 %general-entities;
6]>
7
8<sect1 id="ch-system-glibc" role="wrap">
9 <?dbhtml filename="glibc.html"?>
10
11 <sect1info condition="script">
12 <productname>glibc</productname>
13 <productnumber>&glibc-version;</productnumber>
14 <address>&glibc-url;</address>
15 </sect1info>
16
17 <title>Glibc-&glibc-version;</title>
18
19 <indexterm zone="ch-system-glibc">
20 <primary sortas="a-Glibc">Glibc</primary>
21 </indexterm>
22
23 <sect2 role="package">
24 <title/>
25
26 <para>The Glibc package contains the main C library. This library provides
27 the basic routines for allocating memory, searching directories, opening and
28 closing files, reading and writing files, string handling, pattern matching,
29 arithmetic, and so on.</para>
30
31 <segmentedlist>
32 <segtitle>&buildtime;</segtitle>
33 <segtitle>&diskspace;</segtitle>
34
35 <seglistitem>
[fb386e0]36 <seg>&glibc-fin-sbu;</seg>
37 <seg>&glibc-fin-du;</seg>
[fcc02767]38 </seglistitem>
39 </segmentedlist>
40
41 </sect2>
42
43 <sect2 role="installation">
44 <title>Installation of Glibc</title>
45
46 <para>Some of the Glibc programs use the non-FHS compliant
47 <filename class="directory">/var/db</filename> directory to store
48 their runtime data. Apply the following patch to make such programs
49 store their runtime data in the FHS-compliant locations:</para>
50
51<screen><userinput remap="pre">patch -Np1 -i ../&glibc-fhs-patch;</userinput></screen>
[092b86a]52<!--
[f70694d]53 <para>Now fix a security vulnerability:</para>
[efd1113]54
[f70694d]55<screen><userinput remap="pre">patch -Np1 -i ../&glibc-upstream-patch;</userinput></screen>
[092b86a]56-->
[d672ab7]57 <para>The Glibc documentation recommends building Glibc
[fcc02767]58 in a dedicated build directory:</para>
59
60<screen><userinput remap="pre">mkdir -v build
61cd build</userinput></screen>
62
[4eee9cc]63 <para>Ensure that the <command>ldconfig</command> and <command>sln</command>
[bcb20b4]64 utilities will be installed into
[4eee9cc]65 <filename class="directory">/usr/sbin</filename>:</para>
66
67<screen><userinput remap="pre">echo "rootsbindir=/usr/sbin" &gt; configparms</userinput></screen>
68
[fcc02767]69 <para>Prepare Glibc for compilation:</para>
70
71<screen><userinput remap="configure">../configure --prefix=/usr \
[7054cc6]72 --disable-werror \
[0f18f2b]73 --enable-kernel=&min-kernel; \
[fcc02767]74 --enable-stack-protector=strong \
[25b3c0f]75 --disable-nscd \
[7f25c84]76 libc_cv_slibdir=/usr/lib</userinput></screen>
[9a05e45]77
[fcc02767]78 <variablelist>
[c68e018]79 <title>The meaning of the configure options:</title>
80
[fcc02767]81 <varlistentry>
[c68e018]82 <term><parameter>--disable-werror</parameter></term>
[fcc02767]83 <listitem>
[2760113]84 <para>This option disables the -Werror option passed to
[c68e018]85 GCC. This is necessary for running the test suite.</para>
[fcc02767]86 </listitem>
87 </varlistentry>
[c68e018]88
[fcc02767]89 <varlistentry>
[c68e018]90 <term><parameter>--enable-kernel=&min-kernel;</parameter></term>
[fcc02767]91 <listitem>
[091d624d]92 <para>This option tells the build system that this Glibc may
[c68e018]93 be used with kernels as old as &min-kernel;. This means generating
94 workarounds in case a system call introduced in a later version
95 cannot be used.</para>
[fcc02767]96 </listitem>
97 </varlistentry>
98
99 <varlistentry>
100 <term><parameter>--enable-stack-protector=strong</parameter></term>
101 <listitem>
[d672ab7]102 <para>This option increases system security by adding
[fcc02767]103 extra code to check for buffer overflows, such as stack
[bed3894]104 smashing attacks. Note that Glibc always explicitly overrides
105 the default of GCC, so this option is still needed even though
106 we've already specified <option>--enable-default-ssp</option> for
107 GCC.</para>
[fcc02767]108 </listitem>
109 </varlistentry>
110
[25b3c0f]111 <varlistentry>
112 <term><parameter>--disable-nscd</parameter></term>
113 <listitem>
114 <para>Do not build the name service cache daemon which is no
115 longer used.</para>
116 </listitem>
117 </varlistentry>
118
[fcc02767]119 <varlistentry>
[d7a9421]120 <term><parameter>libc_cv_slibdir=/usr/lib</parameter></term>
[fcc02767]121 <listitem>
122 <para>This variable sets the correct library for all
123 systems. We do not want lib64 to be used.</para>
124 </listitem>
125 </varlistentry>
126
127 </variablelist>
128
129 <para>Compile the package:</para>
130
[d45f50d]131<screen><userinput remap="make">make</userinput></screen>
[fcc02767]132
133 <important>
134 <para>In this section, the test suite for Glibc is considered critical.
135 Do not skip it under any circumstance.</para>
136 </important>
137
138 <para>Generally a few tests do not pass. The test failures listed below
139 are usually safe to ignore.</para>
140
141<!-- Use remap="make" here to work around a jhalfs issue. -->
[df2e99e]142<!--<screen><userinput remap="make">case $(uname -m) in
[fcc02767]143 i?86) ln -sfnv $PWD/elf/ld-linux.so.2 /lib ;;
144 x86_64) ln -sfnv $PWD/elf/ld-linux-x86-64.so.2 /lib ;;
145esac</userinput></screen>
146
147 <note><para>The symbolic link above is needed to run the tests at this
148 stage of building in the chroot environment. It will be overwritten
149 in the install phase below.</para></note>
[df2e99e]150-->
[fcc02767]151<screen><userinput remap="test">make check</userinput></screen>
152
[58ccce5]153 <para>You may see some test failures. The Glibc test suite is
154 somewhat dependent on the host system. A few failures out of
[3bac16dc]155 over 5000 tests can generally be ignored. This is a list of the
[58ccce5]156 most common issues seen for recent versions of LFS:</para>
[fcc02767]157
158 <itemizedlist>
159
[c8fd7fe]160 <listitem>
[d672ab7]161 <para><emphasis>io/tst-lchmod</emphasis>
[c8fd7fe]162 is known to fail in the LFS chroot environment.</para>
163 </listitem>
164
[582da16]165 <listitem>
[0c0b882]166 <para>Some tests, for example
[0800455]167 <emphasis>nss/tst-nss-files-hosts-multi</emphasis> and
168 <emphasis>nptl/tst-thread-affinity*</emphasis>
169 are known to fail due to a timeout (especially when the system is
170 relatively slow and/or running the test suite with multiple
171 parallel make jobs). These tests can be identified with:</para>
172
[887bf34f]173 <screen><userinput remap="test">grep "Timed out" $(find -name \*.out)</userinput></screen>
[0800455]174
175 <para>It's possible to re-run a single test with enlarged timeout
176 with
177 <command>TIMEOUTFACTOR=<replaceable>&lt;factor&gt;</replaceable>
178 make test t=<replaceable>&lt;test name&gt;</replaceable></command>.
179 For example, <command>TIMEOUTFACTOR=10 make test
180 t=nss/tst-nss-files-hosts-multi</command> will re-run
181 <emphasis>nss/tst-nss-files-hosts-multi</emphasis> with ten times
182 the original timeout.</para>
[fcc02767]183 </listitem>
[c500323]184
[057e32dc]185 <listitem>
186 <para>On MIPS, six elf audit tests, the test named
187 <emphasis>elf/tst-ro-dynamic</emphasis>, and the test named
188 <emphasis>elf/tst-sprof-basic</emphasis> are known to fail.</para>
189 </listitem>
190
191 <!-- https://sourceware.org/pipermail/libc-alpha/2024-January/154221.html
192 https://sourceware.org/glibc/wiki/Testing/Tests/stdlib/tst-arc4random-thread -->
193 <listitem>
194 <para>The <emphasis>stdlib/tst-arc4random-thread</emphasis>
195 test is known to fail with some host kernel versions due to a
196 kernel bug on MIPS.</para>
197 </listitem>
198
199 <!-- https://sourceware.org/pipermail/libc-alpha/2024-February/154915.html -->
200 <listitem>
201 <para>Six <emphasis>math</emphasis> tests are known to fail due
202 to outdated test data.</para>
203 </listitem>
204
[fcc02767]205 <listitem>
[8287b51]206 <para>Additionally, some tests may fail with a relatively old CPU
[0800455]207 model (for example
208 <emphasis>elf/tst-cpu-features-cpuinfo</emphasis>) or host kernel
209 version (for example
210 <emphasis>stdlib/tst-arc4random-thread</emphasis>).</para>
[fcc02767]211 </listitem>
212 </itemizedlist>
213
214 <para>Though it is a harmless message, the install stage of Glibc will
215 complain about the absence of <filename>/etc/ld.so.conf</filename>.
216 Prevent this warning with:</para>
217
218<screen><userinput remap="install">touch /etc/ld.so.conf</userinput></screen>
219
[a3bd4689]220 <!-- https://sourceware.org/bugzilla/show_bug.cgi?id=21911 -->
221 <para>Fix the Makefile to skip an outdated sanity check
222 that fails with a modern Glibc configuration:</para>
[fcc02767]223
224<screen><userinput remap="install">sed '/test-installation/s@$(PERL)@echo not running@' -i ../Makefile</userinput></screen>
225
[343ab13]226 <important>
227 <para>
228 If upgrading Glibc to a new minor version (for example, from
229 Glibc-2.36 to Glibc-&glibc-version;) on a running LFS system, you
230 need to take some extra precautions to avoid breaking the system:
231 </para>
232
233 <itemizedlist>
234 <listitem>
235 <!-- There are two reasons we don't support this:
236 1. Upgrading on a system with separate /lib and /usr/lib is
237 tricky.
238 2. With Glibc prior to 2.34 libc.so.6 etc. are symlinks to
239 libc-2.33.so etc., again causing the upgradation tricky.
240 The Glibc NEWS file explicit states they no longer use
241 symlinks for the ABI names to avoid upgradation
242 issues. -->
243 <para>
244 Upgrading Glibc on a LFS system prior to 11.0 (exclusive) is
245 not supported. Rebuild LFS if you are running such an old LFS
246 system but you need a newer Glibc.
247 </para>
248 </listitem>
249
250 <!-- https://sourceware.org/pipermail/libc-alpha/2024-January/154095.html -->
251 <listitem>
252 <para>
253 If upgrading on a LFS system prior to 12.0 (exclusive), install
254 <application>Libxcrypt</application> following
255 <xref role='.' linkend='ch-system-libxcrypt'/> In addition to
256 a normal <application>Libxcrypt</application> installation,
257 <emphasis role='bold'>you MUST follow the note in Libxcrypt
258 section to install
259 <filename class='libraryfile'>libcrypt.so.1*</filename>
[4aa6831f]260 (replacing
[343ab13]261 <filename class='libraryfile'>libcrypt.so.1</filename> from the
262 prior Glibc installation)</emphasis>.
263 </para>
264 </listitem>
265
266 <!-- Otherwise on lfs-systemd nscd will fail to start on boot,
267 and on both lfs-sysv and lfs-systemd useradd etc. will try
268 to start nscd, then nscd will fail to start as well and
269 produce some spurious error message. -->
270 <listitem>
271 <para>
272 If upgrading on a LFS system prior to 12.1 (exclusive),
273 remove the <command>nscd</command> program:
274 </para>
275
276 <screen role='nodump'><userinput>rm -f /usr/sbin/nscd</userinput></screen>
277
[bd003a8]278 <para revision='systemd'>
[343ab13]279 If this system (prior to LFS 12.1, exclusive) is based on
280 Systemd, it's also needed to disable and stop the
281 <command>nscd</command> service now:
282 </para>
283
284 <screen revision='systemd' role='nodump'><userinput>systemctl disable --now nscd</userinput></screen>
285 </listitem>
286
287 <listitem>
288 <para>
289 Upgrade the kernel and reboot if it's older than &min-kernel;
290 (check the current version with <command>uname -r</command>)
291 or if you want to upgrade it anyway, following
292 <xref linkend='ch-bootable-kernel' role='.'/>
293 </para>
294 </listitem>
295
296 <listitem>
297 <para>
298 Upgrade the kernel API headers if it's older than &min-kernel;
299 (check the current version with
300 <command>cat /usr/include/linux/version.h</command>)
301 or if you want to upgrade it anyway, following
302 <xref linkend='ch-tools-linux-headers'/> (but removing
303 <envar>$LFS</envar> from the <command>cp</command> command).
304 </para>
305 </listitem>
306
307 <!-- This is to ensure we don't start a process at the time point
308 where some Glibc shared libraries are updated but the others
309 are not. Such mismatches can cause programs crash on startup,
310 esp. a mismatch between ld-linux-x86-64.so.2 and
311 libc.so.6. Note that a crash in the installation process
312 will leave the system in a state with the mismatch forever,
313 unrecoverable without the help of another distro. -->
314 <listitem>
315 <para>
316 Perform a <envar>DESTDIR</envar> installation and upgrade
317 the Glibc shared libraries on the system using one single
318 <command>install</command> command:
319 </para>
320
321 <screen role='nodump'><userinput>make DESTDIR=$PWD/dest install
322install -vm755 dest/usr/lib/*.so.* /usr/lib</userinput></screen>
323 </listitem>
324 </itemizedlist>
325
326 <para>
327 It's imperative to strictly follow these steps above unless you
328 completely understand what you are doing.
329 <emphasis role='bold'>Any unexpected deviation may render the
330 system completely unusable. YOU ARE WARNED.</emphasis>
331 </para>
332
333 <para>
[677f795]334 Then continue to run the <command>make install</command> command,
335 the <command>sed</command> command against
336 <filename>/usr/bin/ldd</filename>, and the commands to install
337 the locales. Once they are finished, reboot the system
338 immediately.
[343ab13]339 </para>
340 </important>
341
[fcc02767]342 <para>Install the package:</para>
343
344<screen><userinput remap="install">make install</userinput></screen>
[1b1acbed]345
[091d624d]346 <para>Fix a hardcoded path to the executable loader in the
[7bf2e85]347 <command>ldd</command> script:</para>
348
349<screen><userinput remap="install">sed '/RTLDLIST=/s@/usr@@g' -i /usr/bin/ldd</userinput></screen>
[25b3c0f]350<!--
[fcc02767]351 <para>Install the configuration file and runtime directory for
352 <command>nscd</command>:</para>
353
354<screen><userinput remap="install">cp -v ../nscd/nscd.conf /etc/nscd.conf
355mkdir -pv /var/cache/nscd</userinput></screen>
356
[d672ab7]357 <para revision="systemd">Install the systemd support files for
[fcc02767]358 <command>nscd</command>:</para>
359
360 <screen revision="systemd"><userinput remap="install">install -v -Dm644 ../nscd/nscd.tmpfiles /usr/lib/tmpfiles.d/nscd.conf
[d7a9421]361install -v -Dm644 ../nscd/nscd.service /usr/lib/systemd/system/nscd.service</userinput></screen>
[25b3c0f]362-->
[fcc02767]363 <para>Next, install the locales that can make the system respond in a
[091d624d]364 different language. None of these locales are required, but if some of them
365 are missing, the test suites of some packages will skip important
366 test cases.</para>
[fcc02767]367
368 <para>Individual locales can be installed using the
[a5d31dd]369 <command>localedef</command> program. E.g., the second
[fcc02767]370 <command>localedef</command> command below combines the
371 <filename>/usr/share/i18n/locales/cs_CZ</filename>
372 charset-independent locale definition with the
373 <filename>/usr/share/i18n/charmaps/UTF-8.gz</filename>
374 charmap definition and appends the result to the
375 <filename>/usr/lib/locale/locale-archive</filename> file.
376 The following instructions will install the minimum set of
377 locales necessary for the optimal coverage of tests:</para>
378
[9c7437f]379<screen role="nodump"><userinput remap="locale-test">localedef -i C -f UTF-8 C.UTF-8
[fcc02767]380localedef -i cs_CZ -f UTF-8 cs_CZ.UTF-8
381localedef -i de_DE -f ISO-8859-1 de_DE
382localedef -i de_DE@euro -f ISO-8859-15 de_DE@euro
383localedef -i de_DE -f UTF-8 de_DE.UTF-8
384localedef -i el_GR -f ISO-8859-7 el_GR
[cefe505]385localedef -i en_GB -f ISO-8859-1 en_GB
[fcc02767]386localedef -i en_GB -f UTF-8 en_GB.UTF-8
387localedef -i en_HK -f ISO-8859-1 en_HK
388localedef -i en_PH -f ISO-8859-1 en_PH
389localedef -i en_US -f ISO-8859-1 en_US
390localedef -i en_US -f UTF-8 en_US.UTF-8
[cefe505]391localedef -i es_ES -f ISO-8859-15 es_ES@euro
[fcc02767]392localedef -i es_MX -f ISO-8859-1 es_MX
393localedef -i fa_IR -f UTF-8 fa_IR
394localedef -i fr_FR -f ISO-8859-1 fr_FR
395localedef -i fr_FR@euro -f ISO-8859-15 fr_FR@euro
396localedef -i fr_FR -f UTF-8 fr_FR.UTF-8
[cefe505]397localedef -i is_IS -f ISO-8859-1 is_IS
398localedef -i is_IS -f UTF-8 is_IS.UTF-8
[fcc02767]399localedef -i it_IT -f ISO-8859-1 it_IT
[cefe505]400localedef -i it_IT -f ISO-8859-15 it_IT@euro
[fcc02767]401localedef -i it_IT -f UTF-8 it_IT.UTF-8
402localedef -i ja_JP -f EUC-JP ja_JP
[8dd179b]403localedef -i ja_JP -f SHIFT_JIS ja_JP.SJIS 2> /dev/null || true
[fcc02767]404localedef -i ja_JP -f UTF-8 ja_JP.UTF-8
[cefe505]405localedef -i nl_NL@euro -f ISO-8859-15 nl_NL@euro
[fcc02767]406localedef -i ru_RU -f KOI8-R ru_RU.KOI8-R
407localedef -i ru_RU -f UTF-8 ru_RU.UTF-8
[cefe505]408localedef -i se_NO -f UTF-8 se_NO.UTF-8
409localedef -i ta_IN -f UTF-8 ta_IN.UTF-8
[fcc02767]410localedef -i tr_TR -f UTF-8 tr_TR.UTF-8
411localedef -i zh_CN -f GB18030 zh_CN.GB18030
[cefe505]412localedef -i zh_HK -f BIG5-HKSCS zh_HK.BIG5-HKSCS
413localedef -i zh_TW -f UTF-8 zh_TW.UTF-8</userinput></screen>
[fcc02767]414
415 <para>In addition, install the locale for your own country, language and
416 character set.</para>
417
[091d624d]418 <para>Alternatively, install all the locales listed in the
[fcc02767]419 <filename>glibc-&glibc-version;/localedata/SUPPORTED</filename> file
420 (it includes every locale listed above and many more) at once with the
421 following time-consuming command:</para>
422
423<screen><userinput remap="locale-full">make localedata/install-locales</userinput></screen>
424
425 <para>Then use the <command>localedef</command> command to create and
426 install locales not listed in the
427 <filename>glibc-&glibc-version;/localedata/SUPPORTED</filename> file
[49e360b9]428 when you need them. For instance, the following two locales are
429 needed for some tests later in this chapter:</para>
[d672ab7]430
[fecc287]431<screen role="nodump"><userinput remap="locale-full">localedef -i C -f UTF-8 C.UTF-8
[8dd179b]432localedef -i ja_JP -f SHIFT_JIS ja_JP.SJIS 2> /dev/null || true</userinput></screen>
[fcc02767]433
[d672ab7]434 <note><para>Glibc now uses libidn2 when resolving internationalized
[fcc02767]435 domain names. This is a run time dependency. If this capability
[d672ab7]436 is needed, the instructions for installing libidn2 are in the
[fcc02767]437 <ulink url="&blfs-book;general/libidn2.html">BLFS libidn2 page</ulink>.
438 </para></note>
439
440 </sect2>
441
442 <sect2 id="conf-glibc" role="configuration">
443 <title>Configuring Glibc</title>
444
445 <indexterm zone="conf-glibc">
446 <primary sortas="e-/etc/nsswitch.conf">/etc/nsswitch.conf</primary>
447 </indexterm>
448
449 <indexterm zone="conf-glibc">
450 <primary sortas="e-/etc/localtime">/etc/localtime</primary>
451 </indexterm>
452
453 <sect3>
[1cc301f]454 <title>Adding nsswitch.conf</title>
[fcc02767]455
456 <para>The <filename>/etc/nsswitch.conf</filename> file needs to be created
457 because the Glibc defaults do not work well in a networked environment.
458 </para>
459
460 <para>Create a new file <filename>/etc/nsswitch.conf</filename> by running the
461 following:</para>
462
[ba40e32]463<screen revision='sysv'><userinput>cat &gt; /etc/nsswitch.conf &lt;&lt; "EOF"
[fcc02767]464<literal># Begin /etc/nsswitch.conf
465
466passwd: files
467group: files
468shadow: files
469
470hosts: files dns
471networks: files
472
473protocols: files
474services: files
475ethers: files
476rpc: files
477
[ba40e32]478# End /etc/nsswitch.conf</literal>
479EOF</userinput></screen>
480
481<screen revision='systemd'><userinput>cat &gt; /etc/nsswitch.conf &lt;&lt; "EOF"
482<literal># Begin /etc/nsswitch.conf
483
484passwd: files systemd
485group: files systemd
486shadow: files systemd
487
488hosts: mymachines resolve [!UNAVAIL=return] files myhostname dns
489networks: files
490
491protocols: files
492services: files
493ethers: files
494rpc: files
495
[fcc02767]496# End /etc/nsswitch.conf</literal>
497EOF</userinput></screen>
498
499 </sect3>
500
501 <sect3>
[091d624d]502 <title>Adding Time Zone Data</title>
[fcc02767]503
504 <para>Install and set up the time zone data with the following:</para>
505<screen><userinput>tar -xf ../../tzdata&tzdata-version;.tar.gz
506
507ZONEINFO=/usr/share/zoneinfo
508mkdir -pv $ZONEINFO/{posix,right}
509
510for tz in etcetera southamerica northamerica europe africa antarctica \
[a85486d]511 asia australasia backward; do
[fcc02767]512 zic -L /dev/null -d $ZONEINFO ${tz}
513 zic -L /dev/null -d $ZONEINFO/posix ${tz}
514 zic -L leapseconds -d $ZONEINFO/right ${tz}
515done
516
517cp -v zone.tab zone1970.tab iso3166.tab $ZONEINFO
518zic -d $ZONEINFO -p America/New_York
519unset ZONEINFO</userinput></screen>
520
521 <variablelist>
522 <title>The meaning of the zic commands:</title>
523
524 <varlistentry>
525 <term><parameter>zic -L /dev/null ...</parameter></term>
526 <listitem>
[6a156bab]527 <para>This creates posix time zones without any leap seconds. It is
[fcc02767]528 conventional to put these in both
529 <filename class="directory">zoneinfo</filename> and
530 <filename class="directory">zoneinfo/posix</filename>. It is
531 necessary to put the POSIX time zones in
532 <filename class="directory">zoneinfo</filename>, otherwise various
[3c5ecc9]533 test suites will report errors. On an embedded system, where space is
[fcc02767]534 tight and you do not intend to ever update the time zones, you could save
[6a156bab]535 1.9 MB by not using the <filename class="directory">posix</filename>
[3c5ecc9]536 directory, but some applications or test suites might produce some
[fcc02767]537 failures.</para>
538 </listitem>
539 </varlistentry>
540 <varlistentry>
541 <term><parameter>zic -L leapseconds ...</parameter></term>
542 <listitem>
543 <para>This creates right time zones, including leap seconds. On an
544 embedded system, where space is tight and you do not intend to
545 ever update the time zones, or care about the correct time, you could
546 save 1.9MB by omitting the <filename class="directory">right</filename>
547 directory.</para>
548 </listitem>
549 </varlistentry>
550 <varlistentry>
551 <term><parameter>zic ... -p ...</parameter></term>
552 <listitem>
553 <para>This creates the <filename>posixrules</filename> file. We use
[283f7119]554 New York because POSIX requires the daylight saving time rules
[fcc02767]555 to be in accordance with US rules.</para>
556 </listitem>
557 </varlistentry>
558 </variablelist>
559
560
561 <para>One way to determine the local time zone is to run the following
562 script:</para>
563
564<screen role="nodump"><userinput>tzselect</userinput></screen>
565
566 <para>After answering a few questions about the location, the script will
567 output the name of the time zone (e.g.,
568 <emphasis>America/Edmonton</emphasis>). There are also some other possible
569 time zones listed in <filename
570 class='directory'>/usr/share/zoneinfo</filename> such as
571 <emphasis>Canada/Eastern</emphasis> or <emphasis>EST5EDT</emphasis> that
572 are not identified by the script but can be used.</para>
573
574 <para>Then create the <filename>/etc/localtime</filename> file by
575 running:</para>
576
577<screen><userinput>ln -sfv /usr/share/zoneinfo/<replaceable>&lt;xxx&gt;</replaceable> /etc/localtime</userinput></screen>
578
579 <para>Replace <replaceable>&lt;xxx&gt;</replaceable> with the name of the
580 time zone selected (e.g., Canada/Eastern).</para>
581
582 </sect3>
583
584 <sect3 id="conf-ld" role="configuration">
585 <title>Configuring the Dynamic Loader</title>
586
587 <indexterm zone="conf-ld">
588 <primary sortas="e-/etc/ld.so.conf">/etc/ld.so.conf</primary>
589 </indexterm>
590
591 <para>By default, the dynamic loader (<filename
592 class="libraryfile">/lib/ld-linux.so.2</filename>) searches through
[85cdcb09]593 <filename class="directory">/usr/lib</filename> for dynamic libraries
594 that are needed by programs as they are run. However, if there are
595 libraries in directories other than
[fcc02767]596 <filename class="directory">/usr/lib</filename>, these need to be added
597 to the <filename>/etc/ld.so.conf</filename> file in order for the
598 dynamic loader to find them. Two directories that are commonly known
599 to contain additional libraries are <filename
600 class="directory">/usr/local/lib</filename> and <filename
601 class="directory">/opt/lib</filename>, so add those directories to the
602 dynamic loader's search path.</para>
603
604 <para>Create a new file <filename>/etc/ld.so.conf</filename> by running the
605 following:</para>
606
607<screen><userinput>cat &gt; /etc/ld.so.conf &lt;&lt; "EOF"
608<literal># Begin /etc/ld.so.conf
609/usr/local/lib
610/opt/lib
611</literal>
612EOF</userinput></screen>
613
614 <para>If desired, the dynamic loader can also search a directory and
615 include the contents of files found there. Generally the files in
616 this include directory are one line specifying the desired library path.
617 To add this capability run the following commands:</para>
618
619<screen role="nodump"><userinput>cat &gt;&gt; /etc/ld.so.conf &lt;&lt; "EOF"
620<literal># Add an include directory
621include /etc/ld.so.conf.d/*.conf
622</literal>
623EOF
624mkdir -pv /etc/ld.so.conf.d</userinput></screen>
625
626 </sect3>
627 </sect2>
628
629 <sect2 id="contents-glibc" role="content">
630 <title>Contents of Glibc</title>
631
632 <segmentedlist>
633 <segtitle>Installed programs</segtitle>
634 <segtitle>Installed libraries</segtitle>
635 <segtitle>Installed directories</segtitle>
636
637 <seglistitem>
[db3c501]638 <seg>gencat, getconf, getent, iconv, iconvconfig, ldconfig,
[81d3242]639 ldd, lddlibc4,
640 ld.so (symlink to ld-linux-x86-64.so.2 or ld-linux.so.2),
[09d148d]641 locale, localedef, makedb, mtrace,
[fcc02767]642 pcprofiledump, pldd, sln, sotruss, sprof, tzselect, xtrace,
643 zdump, and zic</seg>
[093c8d4b]644 <seg>ld.so.1, ld-linux-mipsn8.so.1
[db3c501]645 libBrokenLocale.{a,so}, libanl.{a,so},
[b7daa52a]646 libc.{a,so}, libc_nonshared.a, libc_malloc_debug.so,
[bbfb090]647 libdl.{a,so.2}, libg.a, libm.{a,so},
[9c7598cc]648 libmcheck.a, libmemusage.so, libmvec.{a,so}, libnsl.so.1,
[fcc02767]649 libnss_compat.so, libnss_dns.so, libnss_files.so, libnss_hesiod.so,
[9c7598cc]650 libpcprofile.so, libpthread.{a,so.0},
651 libresolv.{a,so}, librt.{a,so.1},
652 libthread_db.so, and libutil.{a,so.1}</seg>
[fcc02767]653 <seg>/usr/include/arpa, /usr/include/bits, /usr/include/gnu,
654 /usr/include/net, /usr/include/netash, /usr/include/netatalk,
655 /usr/include/netax25, /usr/include/neteconet, /usr/include/netinet,
656 /usr/include/netipx, /usr/include/netiucv, /usr/include/netpacket,
657 /usr/include/netrom, /usr/include/netrose, /usr/include/nfs,
658 /usr/include/protocols, /usr/include/rpc,
659 /usr/include/sys, /usr/lib/audit, /usr/lib/gconv, /usr/lib/locale,
660 /usr/libexec/getconf, /usr/share/i18n, /usr/share/zoneinfo,
[09d148d]661 and /var/lib/nss_db</seg>
[fcc02767]662 </seglistitem>
663 </segmentedlist>
664
665 <variablelist>
666 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
667 <?dbfo list-presentation="list"?>
668 <?dbhtml list-presentation="table"?>
669
670 <varlistentry id="gencat">
671 <term><command>gencat</command></term>
672 <listitem>
673 <para>Generates message catalogues</para>
674 <indexterm zone="ch-system-glibc gencat">
675 <primary sortas="b-gencat">gencat</primary>
676 </indexterm>
677 </listitem>
678 </varlistentry>
679
680 <varlistentry id="getconf">
681 <term><command>getconf</command></term>
682 <listitem>
683 <para>Displays the system configuration values for file system
684 specific variables</para>
685 <indexterm zone="ch-system-glibc getconf">
686 <primary sortas="b-getconf">getconf</primary>
687 </indexterm>
688 </listitem>
689 </varlistentry>
690
691 <varlistentry id="getent">
692 <term><command>getent</command></term>
693 <listitem>
694 <para>Gets entries from an administrative database</para>
695 <indexterm zone="ch-system-glibc getent">
696 <primary sortas="b-getent">getent</primary>
697 </indexterm>
698 </listitem>
699 </varlistentry>
700
701 <varlistentry id="iconv">
702 <term><command>iconv</command></term>
703 <listitem>
704 <para>Performs character set conversion</para>
705 <indexterm zone="ch-system-glibc iconv">
706 <primary sortas="b-iconv">iconv</primary>
707 </indexterm>
708 </listitem>
709 </varlistentry>
710
711 <varlistentry id="iconvconfig">
712 <term><command>iconvconfig</command></term>
713 <listitem>
714 <para>Creates fastloading <command>iconv</command> module configuration
715 files</para>
716 <indexterm zone="ch-system-glibc iconvconfig">
717 <primary sortas="b-iconvconfig">iconvconfig</primary>
718 </indexterm>
719 </listitem>
720 </varlistentry>
721
722 <varlistentry id="ldconfig">
723 <term><command>ldconfig</command></term>
724 <listitem>
725 <para>Configures the dynamic linker runtime bindings</para>
726 <indexterm zone="ch-system-glibc ldconfig">
727 <primary sortas="b-ldconfig">ldconfig</primary>
728 </indexterm>
729 </listitem>
730 </varlistentry>
731
732 <varlistentry id="ldd">
733 <term><command>ldd</command></term>
734 <listitem>
735 <para>Reports which shared libraries are required
736 by each given program or shared library</para>
737 <indexterm zone="ch-system-glibc ldd">
738 <primary sortas="b-ldd">ldd</primary>
739 </indexterm>
740 </listitem>
741 </varlistentry>
742
743 <varlistentry id="lddlibc4">
744 <term><command>lddlibc4</command></term>
745 <listitem>
[db3c501]746 <para>Assists <command>ldd</command> with object files.
747 It does not exist on newer architectures like x86_64</para>
[fcc02767]748 <indexterm zone="ch-system-glibc lddlibc4">
749 <primary sortas="b-lddlibc4">lddlibc4</primary>
750 </indexterm>
751 </listitem>
752 </varlistentry>
753
754 <varlistentry id="locale">
755 <term><command>locale</command></term>
756 <listitem>
757 <para>Prints various information about the current locale</para>
758 <indexterm zone="ch-system-glibc locale">
759 <primary sortas="b-locale">locale</primary>
760 </indexterm>
761 </listitem>
762 </varlistentry>
763
764 <varlistentry id="localedef">
765 <term><command>localedef</command></term>
766 <listitem>
767 <para>Compiles locale specifications</para>
768 <indexterm zone="ch-system-glibc localedef">
769 <primary sortas="b-localedef">localedef</primary>
770 </indexterm>
771 </listitem>
772 </varlistentry>
773
774 <varlistentry id="makedb">
775 <term><command>makedb</command></term>
776 <listitem>
777 <para>Creates a simple database from textual input</para>
778 <indexterm zone="ch-system-glibc makedb">
779 <primary sortas="b-makedb">makedb</primary>
780 </indexterm>
781 </listitem>
782 </varlistentry>
783
784 <varlistentry id="mtrace">
785 <term><command>mtrace</command></term>
786 <listitem>
787 <para>Reads and interprets a memory trace file and displays a summary
788 in human-readable format</para>
789 <indexterm zone="ch-system-glibc mtrace">
790 <primary sortas="b-mtrace">mtrace</primary>
791 </indexterm>
792 </listitem>
793 </varlistentry>
794
795 <varlistentry id="pcprofiledump">
796 <term><command>pcprofiledump</command></term>
797 <listitem>
798 <para>Dump information generated by PC profiling</para>
799 <indexterm zone="ch-system-glibc pcprofiledump">
800 <primary sortas="b-pcprofiledump">pcprofiledump</primary>
801 </indexterm>
802 </listitem>
803 </varlistentry>
804
805 <varlistentry id="pldd">
806 <term><command>pldd</command></term>
807 <listitem>
808 <para>Lists dynamic shared objects used by running processes</para>
809 <indexterm zone="ch-system-glibc pldd">
810 <primary sortas="b-pldd">pldd</primary>
811 </indexterm>
812 </listitem>
813 </varlistentry>
814
815 <varlistentry id="sln">
816 <term><command>sln</command></term>
817 <listitem>
818 <para>A statically linked <command>ln</command> program</para>
819 <indexterm zone="ch-system-glibc sln">
820 <primary sortas="b-sln">sln</primary>
821 </indexterm>
822 </listitem>
823 </varlistentry>
824
825 <varlistentry id="sotruss">
826 <term><command>sotruss</command></term>
827 <listitem>
828 <para>Traces shared library procedure calls of a specified command</para>
829 <indexterm zone="ch-system-glibc sotruss">
830 <primary sortas="b-sotruss">sotruss</primary>
831 </indexterm>
832 </listitem>
833 </varlistentry>
834
835 <varlistentry id="sprof">
836 <term><command>sprof</command></term>
837 <listitem>
838 <para>Reads and displays shared object profiling data</para>
839 <indexterm zone="ch-system-glibc sprof">
840 <primary sortas="b-sprof">sprof</primary>
841 </indexterm>
842 </listitem>
843 </varlistentry>
844
845 <varlistentry id="tzselect">
846 <term><command>tzselect</command></term>
847 <listitem>
848 <para>Asks the user about the location of the system and reports
849 the corresponding time zone description</para>
850 <indexterm zone="ch-system-glibc tzselect">
851 <primary sortas="b-tzselect">tzselect</primary>
852 </indexterm>
853 </listitem>
854 </varlistentry>
855
856 <varlistentry id="xtrace">
857 <term><command>xtrace</command></term>
858 <listitem>
859 <para>Traces the execution of a program by printing the currently
860 executed function</para>
861 <indexterm zone="ch-system-glibc xtrace">
862 <primary sortas="b-xtrace">xtrace</primary>
863 </indexterm>
864 </listitem>
865 </varlistentry>
866
867 <varlistentry id="zdump">
868 <term><command>zdump</command></term>
869 <listitem>
870 <para>The time zone dumper</para>
871 <indexterm zone="ch-system-glibc zdump">
872 <primary sortas="b-zdump">zdump</primary>
873 </indexterm>
874 </listitem>
875 </varlistentry>
876
877 <varlistentry id="zic">
878 <term><command>zic</command></term>
879 <listitem>
880 <para>The time zone compiler</para>
881 <indexterm zone="ch-system-glibc zic">
882 <primary sortas="b-zic">zic</primary>
883 </indexterm>
884 </listitem>
885 </varlistentry>
886
887 <varlistentry id="ld.so">
[9c7598cc]888 <term><filename class="libraryfile">ld-*.so</filename></term>
[fcc02767]889 <listitem>
890 <para>The helper program for shared library executables</para>
891 <indexterm zone="ch-system-glibc ld.so">
892 <primary sortas="c-ld.so">ld-&glibc-version;.so</primary>
893 </indexterm>
894 </listitem>
895 </varlistentry>
896
897 <varlistentry id="libBrokenLocale">
898 <term><filename class="libraryfile">libBrokenLocale</filename></term>
899 <listitem>
900 <para>Used internally by Glibc as a gross hack to get broken programs
901 (e.g., some Motif applications) running. See comments in
902 <filename>glibc-&glibc-version;/locale/broken_cur_max.c</filename>
903 for more information</para>
904 <indexterm zone="ch-system-glibc libBrokenLocale">
905 <primary sortas="c-libBrokenLocale">libBrokenLocale</primary>
906 </indexterm>
907 </listitem>
908 </varlistentry>
909
910 <varlistentry id="libanl">
911 <term><filename class="libraryfile">libanl</filename></term>
912 <listitem>
[e9ab2b3]913 <para>Dummy library containing no functions. Previously was the
914 asynchronous name lookup library, whose functions are now in
915 <filename class='libraryfile'>libc</filename></para>
[fcc02767]916 <indexterm zone="ch-system-glibc libanl">
917 <primary sortas="c-libanl">libanl</primary>
918 </indexterm>
919 </listitem>
920 </varlistentry>
921
922 <varlistentry id="libc">
923 <term><filename class="libraryfile">libc</filename></term>
924 <listitem>
925 <para>The main C library</para>
926 <indexterm zone="ch-system-glibc libc">
927 <primary sortas="c-libc">libc</primary>
928 </indexterm>
929 </listitem>
930 </varlistentry>
931
[b7daa52a]932 <varlistentry id="libc_malloc_debug">
933 <term><filename class="libraryfile">libc_malloc_debug</filename></term>
934 <listitem>
935 <para>Turns on memory allocation checking when preloaded</para>
936 <indexterm zone="ch-system-glibc libc_malloc_debug">
937 <primary sortas="c-libc_malloc_debug">libc_malloc_debug</primary>
938 </indexterm>
939 </listitem>
940 </varlistentry>
941
[fcc02767]942 <varlistentry id="libdl">
943 <term><filename class="libraryfile">libdl</filename></term>
944 <listitem>
[9c7598cc]945 <para>Dummy library containing no functions. Previously was the
946 dynamic linking interface library, whose functions are now in
947 <filename class="libraryfile">libc</filename></para>
[fcc02767]948 <indexterm zone="ch-system-glibc libdl">
949 <primary sortas="c-libdl">libdl</primary>
950 </indexterm>
951 </listitem>
952 </varlistentry>
953
954 <varlistentry id="libg">
955 <term><filename class="libraryfile">libg</filename></term>
956 <listitem>
957 <para>Dummy library containing no functions. Previously was a runtime
958 library for <command>g++</command></para>
959 <indexterm zone="ch-system-glibc libg">
960 <primary sortas="c-libg">libg</primary>
961 </indexterm>
962 </listitem>
963 </varlistentry>
964
965 <varlistentry id="libm">
966 <term><filename class="libraryfile">libm</filename></term>
967 <listitem>
968 <para>The mathematical library</para>
969 <indexterm zone="ch-system-glibc libm">
970 <primary sortas="c-libm">libm</primary>
971 </indexterm>
972 </listitem>
973 </varlistentry>
974
[b7daa52a]975 <varlistentry id="libmvec">
976 <term><filename class="libraryfile">libmvec</filename></term>
977 <listitem>
978 <para>The vector math library, linked in as needed
979 when <filename class='libraryfile'>libm</filename> is used</para>
980 <indexterm zone="ch-system-glibc libmvec">
981 <primary sortas="c-libmvec">libmvec</primary>
982 </indexterm>
983 </listitem>
984 </varlistentry>
985
[fcc02767]986 <varlistentry id="libmcheck">
987 <term><filename class="libraryfile">libmcheck</filename></term>
988 <listitem>
989 <para>Turns on memory allocation checking when linked to</para>
990 <indexterm zone="ch-system-glibc libmcheck">
991 <primary sortas="c-libmcheck">libmcheck</primary>
992 </indexterm>
993 </listitem>
994 </varlistentry>
995
996 <varlistentry id="libmemusage">
997 <term><filename class="libraryfile">libmemusage</filename></term>
998 <listitem>
999 <para>Used by <command>memusage</command> to help collect
1000 information about the memory usage of a program</para>
1001 <indexterm zone="ch-system-glibc libmemusage">
1002 <primary sortas="c-libmemusage">libmemusage</primary>
1003 </indexterm>
1004 </listitem>
1005 </varlistentry>
1006
1007 <varlistentry id="libnsl">
1008 <term><filename class="libraryfile">libnsl</filename></term>
1009 <listitem>
[9c7598cc]1010 <para>The network services library, now deprecated</para>
[fcc02767]1011 <indexterm zone="ch-system-glibc libnsl">
1012 <primary sortas="c-libnsl">libnsl</primary>
1013 </indexterm>
1014 </listitem>
1015 </varlistentry>
1016
1017 <varlistentry id="libnss">
[b7daa52a]1018 <term><filename class="libraryfile">libnss_*</filename></term>
[fcc02767]1019 <listitem>
[b7daa52a]1020 <para>The Name Service Switch modules, containing functions for
[fcc02767]1021 resolving host names, user names, group names, aliases, services,
[b7daa52a]1022 protocols, etc. Loaded by
1023 <filename class='libraryfile'>libc</filename> according to the
1024 configuration in <filename>/etc/nsswitch.conf</filename></para>
[fcc02767]1025 <indexterm zone="ch-system-glibc libnss">
[b7daa52a]1026 <primary sortas="c-libnss">libnss_*</primary>
[fcc02767]1027 </indexterm>
1028 </listitem>
1029 </varlistentry>
1030
1031 <varlistentry id="libpcprofile">
1032 <term><filename class="libraryfile">libpcprofile</filename></term>
1033 <listitem>
1034 <para>Can be preloaded to PC profile an executable</para>
1035 <indexterm zone="ch-system-glibc libpcprofile">
1036 <primary sortas="c-libpcprofile">libpcprofile</primary>
1037 </indexterm>
1038 </listitem>
1039 </varlistentry>
1040
1041 <varlistentry id="libpthread">
1042 <term><filename class="libraryfile">libpthread</filename></term>
1043 <listitem>
[9c7598cc]1044 <para>Dummy library containing no functions. Previously contained
1045 functions providing most of the interfaces specified
[91d8e69]1046 by the POSIX.1c Threads Extensions and the semaphore interfaces
1047 specified by the POSIX.1b Real-time Extensions, now the functions
1048 are in <filename class="libraryfile">libc</filename></para>
[fcc02767]1049 <indexterm zone="ch-system-glibc libpthread">
1050 <primary sortas="c-libpthread">libpthread</primary>
1051 </indexterm>
1052 </listitem>
1053 </varlistentry>
1054
1055 <varlistentry id="libresolv">
1056 <term><filename class="libraryfile">libresolv</filename></term>
1057 <listitem>
1058 <para>Contains functions for creating, sending, and interpreting
1059 packets to the Internet domain name servers</para>
1060 <indexterm zone="ch-system-glibc libresolv">
1061 <primary sortas="c-libresolv">libresolv</primary>
1062 </indexterm>
1063 </listitem>
1064 </varlistentry>
1065
1066 <varlistentry id="librt">
1067 <term><filename class="libraryfile">librt</filename></term>
1068 <listitem>
1069 <para>Contains functions providing most of the interfaces specified
[91d8e69]1070 by the POSIX.1b Real-time Extensions</para>
[fcc02767]1071 <indexterm zone="ch-system-glibc librt">
1072 <primary sortas="c-librt">librt</primary>
1073 </indexterm>
1074 </listitem>
1075 </varlistentry>
1076
1077 <varlistentry id="libthread_db">
1078 <term><filename class="libraryfile">libthread_db</filename></term>
1079 <listitem>
1080 <para>Contains functions useful for building debuggers for
1081 multi-threaded programs</para>
1082 <indexterm zone="ch-system-glibc libthread_db">
1083 <primary sortas="c-libthread_db">libthread_db</primary>
1084 </indexterm>
1085 </listitem>
1086 </varlistentry>
1087
1088 <varlistentry id="libutil">
1089 <term><filename class="libraryfile">libutil</filename></term>
1090 <listitem>
[99b2938]1091 <para>Dummy library containing no functions. Previously contained
[9c7598cc]1092 code for <quote>standard</quote> functions used in
1093 many different Unix utilities. These functions are now in
1094 <filename class="libraryfile">libc</filename></para>
[fcc02767]1095 <indexterm zone="ch-system-glibc libutil">
1096 <primary sortas="c-libutil">libutil</primary>
1097 </indexterm>
1098 </listitem>
1099 </varlistentry>
1100
1101 </variablelist>
1102
1103 </sect2>
1104
1105</sect1>
Note: See TracBrowser for help on using the repository browser.