source: chapter08/glibc.xml@ 093c8d4b

xry111/mips64el
Last change on this file since 093c8d4b was 093c8d4b, checked in by Xi Ruoyao <xry111@…>, 4 months ago

mips64el: Remove other x86 references

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