source: chapter08/glibc.xml@ 141a1fa

12.1 multilib trunk xry111/arm64 xry111/loongarch xry111/loongarch-12.1 xry111/mips64el
Last change on this file since 141a1fa was 4aa6831f, checked in by Xi Ruoyao <xry111@…>, 4 months ago

glibc: Don't "overwrite" libcrypt.so.1* when updating

As we've already concluded, overwriting a shared object can crash
running processes using code or data from this shared object. For
example if gdm is crashed, we may leave the system unusable :(.

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