source: chapter08/glibc.xml@ 0f35ff0

xry111/clfs-ng
Last change on this file since 0f35ff0 was f286505, checked in by Xi Ruoyao <xry111@…>, 8 months ago

Merge remote-tracking branch 'origin/trunk' into xry111/clfs-ng

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