source: chapter08/glibc.xml

trunk
Last change on this file was 887bf34f, checked in by Xi Ruoyao <xry111@…>, 2 months ago

glibc: Make the command enumerating timed out tests remap="test"

So if a test times out, it will be noted in jhalfs log.

Also remove "-l" so the output will be something like

./nptl/tst-thread-affinity-pthread: Timed out ...

instead of just a puzzling "./nptl/tst-thread-affinity-pthread".

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