source: chapter08/glibc.xml@ 8024387

ml-11.0 multilib
Last change on this file since 8024387 was 8024387, checked in by Thomas Trepl (Moody) <thomas@…>, 3 years ago

Automatic merge of trunk into multilib

  • Property mode set to 100644
File size: 41.1 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
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>The Glibc documentation recommends building Glibc
54 in a dedicated build directory:</para>
55
56<screen><userinput remap="pre">mkdir -v build
57cd build</userinput></screen>
58
59 <para>Ensure that the <command>ldconfig</command> and <command>sln</command>
60 utilites are installed into
61 <filename class="directory">/usr/sbin</filename>:</para>
62
63<screen><userinput remap="pre">echo "rootsbindir=/usr/sbin" &gt; configparms</userinput></screen>
64
65 <para>Prepare Glibc for compilation:</para>
66
67<screen arch="default"><userinput remap="configure">../configure --prefix=/usr \
68 --disable-werror \
69 --enable-kernel=&min-kernel; \
70 --enable-stack-protector=strong \
71 --with-headers=/usr/include \
72 libc_cv_slibdir=/usr/lib</userinput></screen>
73<screen arch="ml_32,ml_x32,ml_all"><userinput remap="configure">../configure --prefix=/usr \
74 --disable-werror \
75 --enable-kernel=&min-kernel; \
76 --enable-stack-protector=strong \
77 --with-headers=/usr/include \
78 --enable-multi-arch \
79 libc_cv_slibdir=/usr/lib</userinput></screen>
80
81 <variablelist>
82 <title>The meaning of the configure options:</title>
83
84 <varlistentry>
85 <term><parameter>--disable-werror</parameter></term>
86 <listitem>
87 <para>This option disables the -Werror option passed to
88 GCC. This is necessary for running the test suite.</para>
89 </listitem>
90 </varlistentry>
91
92 <varlistentry>
93 <term><parameter>--enable-kernel=&min-kernel;</parameter></term>
94 <listitem>
95 <para>This option tells the build system that this glibc may
96 be used with kernels as old as &min-kernel;. This means generating
97 workarounds in case a system call introduced in a later version
98 cannot be used.</para>
99 </listitem>
100 </varlistentry>
101
102 <varlistentry>
103 <term><parameter>--enable-stack-protector=strong</parameter></term>
104 <listitem>
105 <para>This option increases system security by adding
106 extra code to check for buffer overflows, such as stack
107 smashing attacks.</para>
108 </listitem>
109 </varlistentry>
110<!-- do we need this one? -->
111 <varlistentry>
112 <term><parameter>--with-headers=/usr/include</parameter></term>
113 <listitem>
114 <para>This option tells the build system where to find the
115 kernel API headers.</para>
116 </listitem>
117 </varlistentry>
118
119 <varlistentry>
120 <term><parameter>libc_cv_slibdir=/usr/lib</parameter></term>
121 <listitem>
122 <para>This variable sets the correct library for all
123 systems. We do not want lib64 to be used.</para>
124 </listitem>
125 </varlistentry>
126
127 </variablelist>
128
129 <para>Compile the package:</para>
130
131<screen><userinput remap="make">make</userinput></screen>
132
133 <important>
134 <para>In this section, the test suite for Glibc is considered critical.
135 Do not skip it under any circumstance.</para>
136 </important>
137
138 <para>Generally a few tests do not pass. The test failures listed below
139 are usually safe to ignore.</para>
140
141<!-- Use remap="make" here to work around a jhalfs issue. -->
142<!--<screen><userinput remap="make">case $(uname -m) in
143 i?86) ln -sfnv $PWD/elf/ld-linux.so.2 /lib ;;
144 x86_64) ln -sfnv $PWD/elf/ld-linux-x86-64.so.2 /lib ;;
145esac</userinput></screen>
146
147 <note><para>The symbolic link above is needed to run the tests at this
148 stage of building in the chroot environment. It will be overwritten
149 in the install phase below.</para></note>
150-->
151<screen><userinput remap="test">make check</userinput></screen>
152
153 <para>You may see some test failures. The Glibc test suite is
154 somewhat dependent on the host system. A few failures out of
155 over 4200 tests can generally be ignored. This is a list of the
156 most common issues seen for recent versions of LFS:</para>
157
158 <itemizedlist>
159
160 <listitem>
161 <para><emphasis>io/tst-lchmod</emphasis>
162 is known to fail in the LFS chroot environment.</para>
163 </listitem>
164
165 <listitem>
166 <para><emphasis>misc/tst-ttyname</emphasis>
167 is known to fail in the LFS chroot environment.</para>
168 </listitem>
169<!--
170 <listitem>
171 <para>The <emphasis>nss/tst-nss-files-hosts-multi</emphasis>
172 test may fail for reasons that have not been determined.</para>
173 </listitem>
174
175 <listitem>
176 <para>The <emphasis>rt/tst-cputimer{1,2,3}</emphasis> tests depend on
177 the host system kernel. Kernels 4.14.91&ndash;4.14.96,
178 4.19.13&ndash;4.19.18, and 4.20.0&ndash;4.20.5 are known to
179 cause these tests to fail.
180 </para>
181 </listitem>
182
183 <listitem>
184 <para>The math tests sometimes fail when running on
185 systems where the CPU is not a relatively new Intel or
186 AMD processor.</para>
187 </listitem>
188-->
189 </itemizedlist>
190
191 <para>Though it is a harmless message, the install stage of Glibc will
192 complain about the absence of <filename>/etc/ld.so.conf</filename>.
193 Prevent this warning with:</para>
194
195<screen><userinput remap="install">touch /etc/ld.so.conf</userinput></screen>
196
197 <para>Fix the generated Makefile to skip an unneeded sanity check
198 that fails in the LFS partial environment:
199 </para>
200
201<screen><userinput remap="install">sed '/test-installation/s@$(PERL)@echo not running@' -i ../Makefile</userinput></screen>
202
203 <para>Install the package:</para>
204
205<screen><userinput remap="install">make install</userinput></screen>
206
207 <para>Fix hardcoded path to the executable loader in
208 <command>ldd</command> script:</para>
209
210<screen><userinput remap="install">sed '/RTLDLIST=/s@/usr@@g' -i /usr/bin/ldd</userinput></screen>
211
212 <para>Install the configuration file and runtime directory for
213 <command>nscd</command>:</para>
214
215<screen><userinput remap="install">cp -v ../nscd/nscd.conf /etc/nscd.conf
216mkdir -pv /var/cache/nscd</userinput></screen>
217
218 <para revision="systemd">Install the systemd support files for
219 <command>nscd</command>:</para>
220
221 <screen revision="systemd"><userinput remap="install">install -v -Dm644 ../nscd/nscd.tmpfiles /usr/lib/tmpfiles.d/nscd.conf
222install -v -Dm644 ../nscd/nscd.service /usr/lib/systemd/system/nscd.service</userinput></screen>
223
224 <para>Next, install the locales that can make the system respond in a
225 different language. None of the locales are required, but if some of them
226 are missing, the test suites of future packages would skip important
227 testcases.</para>
228
229 <para>Individual locales can be installed using the
230 <command>localedef</command> program. E.g., the first
231 <command>localedef</command> command below combines the
232 <filename>/usr/share/i18n/locales/cs_CZ</filename>
233 charset-independent locale definition with the
234 <filename>/usr/share/i18n/charmaps/UTF-8.gz</filename>
235 charmap definition and appends the result to the
236 <filename>/usr/lib/locale/locale-archive</filename> file.
237 The following instructions will install the minimum set of
238 locales necessary for the optimal coverage of tests:</para>
239
240<screen role="nodump"><userinput remap="locale-test">mkdir -pv /usr/lib/locale
241localedef -i POSIX -f UTF-8 C.UTF-8 2> /dev/null || true
242localedef -i cs_CZ -f UTF-8 cs_CZ.UTF-8
243localedef -i de_DE -f ISO-8859-1 de_DE
244localedef -i de_DE@euro -f ISO-8859-15 de_DE@euro
245localedef -i de_DE -f UTF-8 de_DE.UTF-8
246localedef -i el_GR -f ISO-8859-7 el_GR
247localedef -i en_GB -f ISO-8859-1 en_GB
248localedef -i en_GB -f UTF-8 en_GB.UTF-8
249localedef -i en_HK -f ISO-8859-1 en_HK
250localedef -i en_PH -f ISO-8859-1 en_PH
251localedef -i en_US -f ISO-8859-1 en_US
252localedef -i en_US -f UTF-8 en_US.UTF-8
253localedef -i es_ES -f ISO-8859-15 es_ES@euro
254localedef -i es_MX -f ISO-8859-1 es_MX
255localedef -i fa_IR -f UTF-8 fa_IR
256localedef -i fr_FR -f ISO-8859-1 fr_FR
257localedef -i fr_FR@euro -f ISO-8859-15 fr_FR@euro
258localedef -i fr_FR -f UTF-8 fr_FR.UTF-8
259localedef -i is_IS -f ISO-8859-1 is_IS
260localedef -i is_IS -f UTF-8 is_IS.UTF-8
261localedef -i it_IT -f ISO-8859-1 it_IT
262localedef -i it_IT -f ISO-8859-15 it_IT@euro
263localedef -i it_IT -f UTF-8 it_IT.UTF-8
264localedef -i ja_JP -f EUC-JP ja_JP
265localedef -i ja_JP -f SHIFT_JIS ja_JP.SIJS 2> /dev/null || true
266localedef -i ja_JP -f UTF-8 ja_JP.UTF-8
267localedef -i nl_NL@euro -f ISO-8859-15 nl_NL@euro
268localedef -i ru_RU -f KOI8-R ru_RU.KOI8-R
269localedef -i ru_RU -f UTF-8 ru_RU.UTF-8
270localedef -i se_NO -f UTF-8 se_NO.UTF-8
271localedef -i ta_IN -f UTF-8 ta_IN.UTF-8
272localedef -i tr_TR -f UTF-8 tr_TR.UTF-8
273localedef -i zh_CN -f GB18030 zh_CN.GB18030
274localedef -i zh_HK -f BIG5-HKSCS zh_HK.BIG5-HKSCS
275localedef -i zh_TW -f UTF-8 zh_TW.UTF-8</userinput></screen>
276
277 <para>In addition, install the locale for your own country, language and
278 character set.</para>
279
280 <para>Alternatively, install all locales listed in the
281 <filename>glibc-&glibc-version;/localedata/SUPPORTED</filename> file
282 (it includes every locale listed above and many more) at once with the
283 following time-consuming command:</para>
284
285<screen><userinput remap="locale-full">make localedata/install-locales</userinput></screen>
286
287 <para>Then use the <command>localedef</command> command to create and
288 install locales not listed in the
289 <filename>glibc-&glibc-version;/localedata/SUPPORTED</filename> file
290 when you need them. For instance, the following two locales are
291 needed for some tests later in this chapter:</para>
292
293<screen role="nodump"><userinput remap="locale-full">localedef -i POSIX -f UTF-8 C.UTF-8 2> /dev/null || true
294localedef -i ja_JP -f SHIFT_JIS ja_JP.SIJS 2> /dev/null || true</userinput></screen>
295
296 <note><para>Glibc now uses libidn2 when resolving internationalized
297 domain names. This is a run time dependency. If this capability
298 is needed, the instructions for installing libidn2 are in the
299 <ulink url="&blfs-book;general/libidn2.html">BLFS libidn2 page</ulink>.
300 </para></note>
301
302 </sect2>
303
304 <sect2 id="conf-glibc" role="configuration">
305 <title>Configuring Glibc</title>
306
307 <indexterm zone="conf-glibc">
308 <primary sortas="e-/etc/nsswitch.conf">/etc/nsswitch.conf</primary>
309 </indexterm>
310
311 <indexterm zone="conf-glibc">
312 <primary sortas="e-/etc/localtime">/etc/localtime</primary>
313 </indexterm>
314
315 <sect3>
316 <title>Adding nsswitch.conf</title>
317
318 <para>The <filename>/etc/nsswitch.conf</filename> file needs to be created
319 because the Glibc defaults do not work well in a networked environment.
320 </para>
321
322 <para>Create a new file <filename>/etc/nsswitch.conf</filename> by running the
323 following:</para>
324
325<screen><userinput>cat &gt; /etc/nsswitch.conf &lt;&lt; "EOF"
326<literal># Begin /etc/nsswitch.conf
327
328passwd: files
329group: files
330shadow: files
331
332hosts: files dns
333networks: files
334
335protocols: files
336services: files
337ethers: files
338rpc: files
339
340# End /etc/nsswitch.conf</literal>
341EOF</userinput></screen>
342
343 </sect3>
344
345 <sect3>
346 <title>Adding time zone data</title>
347
348 <para>Install and set up the time zone data with the following:</para>
349<screen><userinput>tar -xf ../../tzdata&tzdata-version;.tar.gz
350
351ZONEINFO=/usr/share/zoneinfo
352mkdir -pv $ZONEINFO/{posix,right}
353
354for tz in etcetera southamerica northamerica europe africa antarctica \
355 asia australasia backward; do
356 zic -L /dev/null -d $ZONEINFO ${tz}
357 zic -L /dev/null -d $ZONEINFO/posix ${tz}
358 zic -L leapseconds -d $ZONEINFO/right ${tz}
359done
360
361cp -v zone.tab zone1970.tab iso3166.tab $ZONEINFO
362zic -d $ZONEINFO -p America/New_York
363unset ZONEINFO</userinput></screen>
364
365 <variablelist>
366 <title>The meaning of the zic commands:</title>
367
368 <varlistentry>
369 <term><parameter>zic -L /dev/null ...</parameter></term>
370 <listitem>
371 <para>This creates posix time zones without any leap seconds. It is
372 conventional to put these in both
373 <filename class="directory">zoneinfo</filename> and
374 <filename class="directory">zoneinfo/posix</filename>. It is
375 necessary to put the POSIX time zones in
376 <filename class="directory">zoneinfo</filename>, otherwise various
377 test-suites will report errors. On an embedded system, where space is
378 tight and you do not intend to ever update the time zones, you could save
379 1.9 MB by not using the <filename class="directory">posix</filename>
380 directory, but some applications or test-suites might produce some
381 failures.</para>
382 </listitem>
383 </varlistentry>
384 <varlistentry>
385 <term><parameter>zic -L leapseconds ...</parameter></term>
386 <listitem>
387 <para>This creates right time zones, including leap seconds. On an
388 embedded system, where space is tight and you do not intend to
389 ever update the time zones, or care about the correct time, you could
390 save 1.9MB by omitting the <filename class="directory">right</filename>
391 directory.</para>
392 </listitem>
393 </varlistentry>
394 <varlistentry>
395 <term><parameter>zic ... -p ...</parameter></term>
396 <listitem>
397 <para>This creates the <filename>posixrules</filename> file. We use
398 New York because POSIX requires the daylight savings time rules
399 to be in accordance with US rules.</para>
400 </listitem>
401 </varlistentry>
402 </variablelist>
403
404
405 <para>One way to determine the local time zone is to run the following
406 script:</para>
407
408<screen role="nodump"><userinput>tzselect</userinput></screen>
409
410 <para>After answering a few questions about the location, the script will
411 output the name of the time zone (e.g.,
412 <emphasis>America/Edmonton</emphasis>). There are also some other possible
413 time zones listed in <filename
414 class='directory'>/usr/share/zoneinfo</filename> such as
415 <emphasis>Canada/Eastern</emphasis> or <emphasis>EST5EDT</emphasis> that
416 are not identified by the script but can be used.</para>
417
418 <para>Then create the <filename>/etc/localtime</filename> file by
419 running:</para>
420
421<screen><userinput>ln -sfv /usr/share/zoneinfo/<replaceable>&lt;xxx&gt;</replaceable> /etc/localtime</userinput></screen>
422
423 <para>Replace <replaceable>&lt;xxx&gt;</replaceable> with the name of the
424 time zone selected (e.g., Canada/Eastern).</para>
425
426 </sect3>
427
428 <sect3 id="conf-ld" role="configuration">
429 <title>Configuring the Dynamic Loader</title>
430
431 <indexterm zone="conf-ld">
432 <primary sortas="e-/etc/ld.so.conf">/etc/ld.so.conf</primary>
433 </indexterm>
434
435 <para>By default, the dynamic loader (<filename
436 class="libraryfile">/lib/ld-linux.so.2</filename>) searches through
437 <filename class="directory">/lib</filename> and <filename
438 class="directory">/usr/lib</filename> for dynamic libraries that are
439 needed by programs as they are run. However, if there are libraries in
440 directories other than <filename class="directory">/lib</filename> and
441 <filename class="directory">/usr/lib</filename>, these need to be added
442 to the <filename>/etc/ld.so.conf</filename> file in order for the
443 dynamic loader to find them. Two directories that are commonly known
444 to contain additional libraries are <filename
445 class="directory">/usr/local/lib</filename> and <filename
446 class="directory">/opt/lib</filename>, so add those directories to the
447 dynamic loader's search path.</para>
448
449 <para>Create a new file <filename>/etc/ld.so.conf</filename> by running the
450 following:</para>
451
452<screen><userinput>cat &gt; /etc/ld.so.conf &lt;&lt; "EOF"
453<literal># Begin /etc/ld.so.conf
454/usr/local/lib
455/opt/lib
456</literal>
457EOF</userinput></screen>
458
459 <para>If desired, the dynamic loader can also search a directory and
460 include the contents of files found there. Generally the files in
461 this include directory are one line specifying the desired library path.
462 To add this capability run the following commands:</para>
463
464<screen role="nodump"><userinput>cat &gt;&gt; /etc/ld.so.conf &lt;&lt; "EOF"
465<literal># Add an include directory
466include /etc/ld.so.conf.d/*.conf
467</literal>
468EOF
469mkdir -pv /etc/ld.so.conf.d</userinput></screen>
470
471 </sect3>
472 </sect2>
473
474 <!-- - - - - - - - - - -->
475 <!-- Multilib - 32bit -->
476 <!-- - - - - - - - - - -->
477 <sect2 arch="ml_32,ml_all">
478 <title>Building Glibc - 32bit</title>
479
480 <para>Now recompile for m32. The extracted source can be
481 reused but needs to be cleaned before installing the m32
482 version of Glibc.</para>
483
484 <para>Clear the build directory and remove artefacts from
485 previous build:</para>
486
487<screen><userinput remap="pre">rm -rf ./*
488find .. -name "*.a" -delete</userinput></screen>
489
490 <para>Configure Glibc for m32 with the following commands:</para>
491
492<screen><userinput remap="configure">CC="gcc -m32" CXX="g++ -m32" \
493../configure \
494 --prefix=/usr \
495 --host=i686-pc-linux-gnu \
496 --build=$(../scripts/config.guess) \
497 --enable-kernel=&min-kernel; \
498 --with-headers=/usr/include \
499 --enable-multi-arch \
500 --libdir=/usr/lib32 \
501 --libexecdir=/usr/lib32 \
502 libc_cv_slibdir=/usr/lib32</userinput></screen>
503
504 <para>Compile the package:</para>
505
506<screen><userinput remap="make">make</userinput></screen>
507
508 <para>Install the package:</para>
509
510<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
511cp -a DESTDIR/usr/lib32/* /usr/lib32/
512install -vm644 DESTDIR/usr/include/gnu/{lib-names,stubs}-32.h \
513 /usr/include/gnu/</userinput></screen>
514<!-- no longer required as they are created in chap5
515ln -svf ../lib32/ld-linux.so.2 /lib/ld-linux.so.2
516-->
517
518 <para>Add the library name to the dynamic loader config:</para>
519
520<screen role="install"><userinput>echo "/usr/lib32" &gt;&gt; /etc/ld.so.conf</userinput></screen>
521
522 <caution>
523 <para>At this point, it is imperative to stop and ensure that the basic
524 functions (compiling and linking) of the new toolchain are working as
525 expected. To perform a sanity check, run the following commands:</para>
526
527<screen><userinput>echo 'int main(){}' &gt; dummy.c
528gcc -m32 dummy.c
529readelf -l a.out | grep '/ld-linux'</userinput></screen>
530
531 <para>If everything is working correctly, there should be no errors,
532 and the output of the last command will be of the form:</para>
533
534<screen><computeroutput>[Requesting program interpreter: /lib/ld-linux.so.2]</computeroutput></screen>
535
536 <para>If the output is not shown as above or there was no output at all,
537 then something is wrong. Investigate and retrace the steps to find out
538 where the problem is and correct it. This issue must be resolved before
539 continuing on.</para>
540
541 <para>Once all is well, clean up the test files:</para>
542
543<screen><userinput>rm -v dummy.c a.out</userinput></screen>
544
545 </caution>
546
547 </sect2><!-- m32 -->
548
549 <!-- - - - - - - - - - -->
550 <!-- Multilib - x32bit -->
551 <!-- - - - - - - - - - -->
552
553 <sect2 arch="ml_x32,ml_all">
554 <title>Building Glibc - x32bit</title>
555
556 <para>Now recompile for mx32. The extracted source can be
557 reused but needs to be cleaned before installing the mx32
558 version of Glibc.</para>
559
560 <para>Clear the build directory and remove artefacts from
561 previous build:</para>
562
563<screen><userinput remap="pre">rm -rf ./*
564find .. -name "*.a" -delete</userinput></screen>
565
566 <para>Configure Glibc for mx32 with the following commands:</para>
567
568<screen><userinput remap="configure">CC="gcc -mx32" CXX="g++ -mx32" \
569../configure \
570 --prefix=/usr \
571 --host=x86_64-pc-linux-gnux32 \
572 --build=$(../scripts/config.guess) \
573 --enable-kernel=&min-kernel; \
574 --with-headers=/usr/include \
575 --enable-multi-arch \
576 --libdir=/usr/libx32 \
577 --libexecdir=/usr/libx32 \
578 libc_cv_slibdir=/usr/libx32</userinput></screen>
579
580 <para>Compile the package:</para>
581
582<screen><userinput remap="make">make</userinput></screen>
583
584 <para>Install the package:</para>
585
586<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
587cp -a DESTDIR/usr/libx32/* /usr/libx32/
588install -vm644 DESTDIR/usr/include/gnu/{lib-names,stubs}-x32.h \
589 /usr/include/gnu/</userinput></screen>
590<!-- no longer required as they are created in chap5
591ln -svf ../libx32/ld-linux-x32.so.2 /lib/ld-linux-x32.so.2
592-->
593 <para>Add the library name to the dynamic loader config:</para>
594
595<screen role="install"><userinput>echo "/usr/libx32" &gt;&gt; /etc/ld.so.conf</userinput></screen>
596
597 <caution>
598 <para>At this point, it is imperative to stop and ensure that the basic
599 functions (compiling and linking) of the new toolchain are working as
600 expected. To perform a sanity check, run the following commands:</para>
601
602<screen><userinput>echo 'int main(){}' &gt; dummy.c
603gcc -mx32 dummy.c
604readelf -l a.out | grep '/ld-linux-x32'</userinput></screen>
605
606 <para>If everything is working correctly, there should be no errors,
607 and the output of the last command will be of the form:</para>
608
609<screen><computeroutput>[Requesting program interpreter: /libx32/ld-linux-x32.so.2]</computeroutput></screen>
610
611 <para>If the output is not shown as above or there was no output at all,
612 then something is wrong. Investigate and retrace the steps to find out
613 where the problem is and correct it. This issue must be resolved before
614 continuing on.</para>
615
616 <para>Once all is well, clean up the test files:</para>
617
618<screen><userinput>rm -v dummy.c a.out</userinput></screen>
619
620 </caution>
621
622 </sect2><!-- mx32 -->
623
624 <sect2 id="contents-glibc" role="content">
625 <title>Contents of Glibc</title>
626
627 <segmentedlist>
628 <segtitle>Installed programs</segtitle>
629 <segtitle>Installed libraries</segtitle>
630 <segtitle>Installed directories</segtitle>
631
632 <seglistitem>
633 <seg>catchsegv, gencat, getconf, getent, iconv, iconvconfig, ldconfig,
634 ldd, lddlibc4, locale, localedef, makedb, mtrace, nscd,
635 pcprofiledump, pldd, sln, sotruss, sprof, tzselect, xtrace,
636 zdump, and zic</seg>
637 <seg>ld-linux-x86-64.so.2, ld-linux.so.2,
638 libBrokenLocale.{a,so}, libSegFault.so, libanl.{a,so},
639 libc.{a,so}, libc_nonshared.a,
640 libcrypt.{a,so}, libdl.{a,so.2}, libg.a, libm.{a,so},
641 libmcheck.a, libmemusage.so, libmvec.{a,so}, libnsl.so.1,
642 libnss_compat.so, libnss_dns.so, libnss_files.so, libnss_hesiod.so,
643 libpcprofile.so, libpthread.{a,so.0},
644 libresolv.{a,so}, librt.{a,so.1},
645 libthread_db.so, and libutil.{a,so.1}</seg>
646 <seg>/usr/include/arpa, /usr/include/bits, /usr/include/gnu,
647 /usr/include/net, /usr/include/netash, /usr/include/netatalk,
648 /usr/include/netax25, /usr/include/neteconet, /usr/include/netinet,
649 /usr/include/netipx, /usr/include/netiucv, /usr/include/netpacket,
650 /usr/include/netrom, /usr/include/netrose, /usr/include/nfs,
651 /usr/include/protocols, /usr/include/rpc,
652 /usr/include/sys, /usr/lib/audit, /usr/lib/gconv, /usr/lib/locale,
653 /usr/libexec/getconf, /usr/share/i18n, /usr/share/zoneinfo,
654 /var/cache/nscd, and /var/lib/nss_db</seg>
655 </seglistitem>
656 </segmentedlist>
657
658 <variablelist>
659 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
660 <?dbfo list-presentation="list"?>
661 <?dbhtml list-presentation="table"?>
662
663 <varlistentry id="catchsegv">
664 <term><command>catchsegv</command></term>
665 <listitem>
666 <para>Can be used to create a stack trace when a program
667 terminates with a segmentation fault</para>
668 <indexterm zone="ch-system-glibc catchsegv">
669 <primary sortas="b-catchsegv">catchsegv</primary>
670 </indexterm>
671 </listitem>
672 </varlistentry>
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</para>
751 <indexterm zone="ch-system-glibc lddlibc4">
752 <primary sortas="b-lddlibc4">lddlibc4</primary>
753 </indexterm>
754 </listitem>
755 </varlistentry>
756
757 <varlistentry id="locale">
758 <term><command>locale</command></term>
759 <listitem>
760 <para>Prints various information about the current locale</para>
761 <indexterm zone="ch-system-glibc locale">
762 <primary sortas="b-locale">locale</primary>
763 </indexterm>
764 </listitem>
765 </varlistentry>
766
767 <varlistentry id="localedef">
768 <term><command>localedef</command></term>
769 <listitem>
770 <para>Compiles locale specifications</para>
771 <indexterm zone="ch-system-glibc localedef">
772 <primary sortas="b-localedef">localedef</primary>
773 </indexterm>
774 </listitem>
775 </varlistentry>
776
777 <varlistentry id="makedb">
778 <term><command>makedb</command></term>
779 <listitem>
780 <para>Creates a simple database from textual input</para>
781 <indexterm zone="ch-system-glibc makedb">
782 <primary sortas="b-makedb">makedb</primary>
783 </indexterm>
784 </listitem>
785 </varlistentry>
786
787 <varlistentry id="mtrace">
788 <term><command>mtrace</command></term>
789 <listitem>
790 <para>Reads and interprets a memory trace file and displays a summary
791 in human-readable format</para>
792 <indexterm zone="ch-system-glibc mtrace">
793 <primary sortas="b-mtrace">mtrace</primary>
794 </indexterm>
795 </listitem>
796 </varlistentry>
797
798 <varlistentry id="nscd">
799 <term><command>nscd</command></term>
800 <listitem>
801 <para>A daemon that provides a cache for the most common name
802 service requests</para>
803 <indexterm zone="ch-system-glibc nscd">
804 <primary sortas="b-nscd">nscd</primary>
805 </indexterm>
806 </listitem>
807 </varlistentry>
808
809 <varlistentry id="pcprofiledump">
810 <term><command>pcprofiledump</command></term>
811 <listitem>
812 <para>Dump information generated by PC profiling</para>
813 <indexterm zone="ch-system-glibc pcprofiledump">
814 <primary sortas="b-pcprofiledump">pcprofiledump</primary>
815 </indexterm>
816 </listitem>
817 </varlistentry>
818
819 <varlistentry id="pldd">
820 <term><command>pldd</command></term>
821 <listitem>
822 <para>Lists dynamic shared objects used by running processes</para>
823 <indexterm zone="ch-system-glibc pldd">
824 <primary sortas="b-pldd">pldd</primary>
825 </indexterm>
826 </listitem>
827 </varlistentry>
828
829 <varlistentry id="sln">
830 <term><command>sln</command></term>
831 <listitem>
832 <para>A statically linked <command>ln</command> program</para>
833 <indexterm zone="ch-system-glibc sln">
834 <primary sortas="b-sln">sln</primary>
835 </indexterm>
836 </listitem>
837 </varlistentry>
838
839 <varlistentry id="sotruss">
840 <term><command>sotruss</command></term>
841 <listitem>
842 <para>Traces shared library procedure calls of a specified command</para>
843 <indexterm zone="ch-system-glibc sotruss">
844 <primary sortas="b-sotruss">sotruss</primary>
845 </indexterm>
846 </listitem>
847 </varlistentry>
848
849 <varlistentry id="sprof">
850 <term><command>sprof</command></term>
851 <listitem>
852 <para>Reads and displays shared object profiling data</para>
853 <indexterm zone="ch-system-glibc sprof">
854 <primary sortas="b-sprof">sprof</primary>
855 </indexterm>
856 </listitem>
857 </varlistentry>
858
859 <varlistentry id="tzselect">
860 <term><command>tzselect</command></term>
861 <listitem>
862 <para>Asks the user about the location of the system and reports
863 the corresponding time zone description</para>
864 <indexterm zone="ch-system-glibc tzselect">
865 <primary sortas="b-tzselect">tzselect</primary>
866 </indexterm>
867 </listitem>
868 </varlistentry>
869
870 <varlistentry id="xtrace">
871 <term><command>xtrace</command></term>
872 <listitem>
873 <para>Traces the execution of a program by printing the currently
874 executed function</para>
875 <indexterm zone="ch-system-glibc xtrace">
876 <primary sortas="b-xtrace">xtrace</primary>
877 </indexterm>
878 </listitem>
879 </varlistentry>
880
881 <varlistentry id="zdump">
882 <term><command>zdump</command></term>
883 <listitem>
884 <para>The time zone dumper</para>
885 <indexterm zone="ch-system-glibc zdump">
886 <primary sortas="b-zdump">zdump</primary>
887 </indexterm>
888 </listitem>
889 </varlistentry>
890
891 <varlistentry id="zic">
892 <term><command>zic</command></term>
893 <listitem>
894 <para>The time zone compiler</para>
895 <indexterm zone="ch-system-glibc zic">
896 <primary sortas="b-zic">zic</primary>
897 </indexterm>
898 </listitem>
899 </varlistentry>
900
901 <varlistentry id="ld.so">
902 <term><filename class="libraryfile">ld-*.so</filename></term>
903 <listitem>
904 <para>The helper program for shared library executables</para>
905 <indexterm zone="ch-system-glibc ld.so">
906 <primary sortas="c-ld.so">ld-&glibc-version;.so</primary>
907 </indexterm>
908 </listitem>
909 </varlistentry>
910
911 <varlistentry id="libBrokenLocale">
912 <term><filename class="libraryfile">libBrokenLocale</filename></term>
913 <listitem>
914 <para>Used internally by Glibc as a gross hack to get broken programs
915 (e.g., some Motif applications) running. See comments in
916 <filename>glibc-&glibc-version;/locale/broken_cur_max.c</filename>
917 for more information</para>
918 <indexterm zone="ch-system-glibc libBrokenLocale">
919 <primary sortas="c-libBrokenLocale">libBrokenLocale</primary>
920 </indexterm>
921 </listitem>
922 </varlistentry>
923
924 <varlistentry id="libSegFault">
925 <term><filename class="libraryfile">libSegFault</filename></term>
926 <listitem>
927 <para>The segmentation fault signal handler, used by
928 <command>catchsegv</command></para>
929 <indexterm zone="ch-system-glibc libSegFault">
930 <primary sortas="c-libSegFault">libSegFault</primary>
931 </indexterm>
932 </listitem>
933 </varlistentry>
934
935 <varlistentry id="libanl">
936 <term><filename class="libraryfile">libanl</filename></term>
937 <listitem>
938 <para>An asynchronous name lookup library</para>
939 <indexterm zone="ch-system-glibc libanl">
940 <primary sortas="c-libanl">libanl</primary>
941 </indexterm>
942 </listitem>
943 </varlistentry>
944
945 <varlistentry id="libc">
946 <term><filename class="libraryfile">libc</filename></term>
947 <listitem>
948 <para>The main C library</para>
949 <indexterm zone="ch-system-glibc libc">
950 <primary sortas="c-libc">libc</primary>
951 </indexterm>
952 </listitem>
953 </varlistentry>
954
955 <varlistentry id="libcrypt">
956 <term><filename class="libraryfile">libcrypt</filename></term>
957 <listitem>
958 <para>The cryptography library</para>
959 <indexterm zone="ch-system-glibc libcrypt">
960 <primary sortas="c-libcrypt">libcrypt</primary>
961 </indexterm>
962 </listitem>
963 </varlistentry>
964
965 <varlistentry id="libdl">
966 <term><filename class="libraryfile">libdl</filename></term>
967 <listitem>
968 <para>Dummy library containing no functions. Previously was the
969 dynamic linking interface library, whose functions are now in
970 <filename class="libraryfile">libc</filename></para>
971 <indexterm zone="ch-system-glibc libdl">
972 <primary sortas="c-libdl">libdl</primary>
973 </indexterm>
974 </listitem>
975 </varlistentry>
976
977 <varlistentry id="libg">
978 <term><filename class="libraryfile">libg</filename></term>
979 <listitem>
980 <para>Dummy library containing no functions. Previously was a runtime
981 library for <command>g++</command></para>
982 <indexterm zone="ch-system-glibc libg">
983 <primary sortas="c-libg">libg</primary>
984 </indexterm>
985 </listitem>
986 </varlistentry>
987
988 <varlistentry id="libm">
989 <term><filename class="libraryfile">libm</filename></term>
990 <listitem>
991 <para>The mathematical library</para>
992 <indexterm zone="ch-system-glibc libm">
993 <primary sortas="c-libm">libm</primary>
994 </indexterm>
995 </listitem>
996 </varlistentry>
997
998 <varlistentry id="libmcheck">
999 <term><filename class="libraryfile">libmcheck</filename></term>
1000 <listitem>
1001 <para>Turns on memory allocation checking when linked to</para>
1002 <indexterm zone="ch-system-glibc libmcheck">
1003 <primary sortas="c-libmcheck">libmcheck</primary>
1004 </indexterm>
1005 </listitem>
1006 </varlistentry>
1007
1008 <varlistentry id="libmemusage">
1009 <term><filename class="libraryfile">libmemusage</filename></term>
1010 <listitem>
1011 <para>Used by <command>memusage</command> to help collect
1012 information about the memory usage of a program</para>
1013 <indexterm zone="ch-system-glibc libmemusage">
1014 <primary sortas="c-libmemusage">libmemusage</primary>
1015 </indexterm>
1016 </listitem>
1017 </varlistentry>
1018
1019 <varlistentry id="libnsl">
1020 <term><filename class="libraryfile">libnsl</filename></term>
1021 <listitem>
1022 <para>The network services library, now deprecated</para>
1023 <indexterm zone="ch-system-glibc libnsl">
1024 <primary sortas="c-libnsl">libnsl</primary>
1025 </indexterm>
1026 </listitem>
1027 </varlistentry>
1028
1029 <varlistentry id="libnss">
1030 <term><filename class="libraryfile">libnss</filename></term>
1031 <listitem>
1032 <para>The Name Service Switch libraries, containing functions for
1033 resolving host names, user names, group names, aliases, services,
1034 protocols, etc.</para>
1035 <indexterm zone="ch-system-glibc libnss">
1036 <primary sortas="c-libnss">libnss</primary>
1037 </indexterm>
1038 </listitem>
1039 </varlistentry>
1040
1041 <varlistentry id="libpcprofile">
1042 <term><filename class="libraryfile">libpcprofile</filename></term>
1043 <listitem>
1044 <para>Can be preloaded to PC profile an executable</para>
1045 <indexterm zone="ch-system-glibc libpcprofile">
1046 <primary sortas="c-libpcprofile">libpcprofile</primary>
1047 </indexterm>
1048 </listitem>
1049 </varlistentry>
1050
1051 <varlistentry id="libpthread">
1052 <term><filename class="libraryfile">libpthread</filename></term>
1053 <listitem>
1054 <para>Dummy library containing no functions. Previously contained
1055 functions providing most of the interfaces specified
1056 by the POSIX.1b Realtime Extension, now the functions are in
1057 <filename class="libraryfile">libc</filename></para>
1058 <indexterm zone="ch-system-glibc libpthread">
1059 <primary sortas="c-libpthread">libpthread</primary>
1060 </indexterm>
1061 </listitem>
1062 </varlistentry>
1063
1064 <varlistentry id="libresolv">
1065 <term><filename class="libraryfile">libresolv</filename></term>
1066 <listitem>
1067 <para>Contains functions for creating, sending, and interpreting
1068 packets to the Internet domain name servers</para>
1069 <indexterm zone="ch-system-glibc libresolv">
1070 <primary sortas="c-libresolv">libresolv</primary>
1071 </indexterm>
1072 </listitem>
1073 </varlistentry>
1074
1075 <varlistentry id="librt">
1076 <term><filename class="libraryfile">librt</filename></term>
1077 <listitem>
1078 <para>Contains functions providing most of the interfaces specified
1079 by the POSIX.1b Realtime Extension</para>
1080 <indexterm zone="ch-system-glibc librt">
1081 <primary sortas="c-librt">librt</primary>
1082 </indexterm>
1083 </listitem>
1084 </varlistentry>
1085
1086 <varlistentry id="libthread_db">
1087 <term><filename class="libraryfile">libthread_db</filename></term>
1088 <listitem>
1089 <para>Contains functions useful for building debuggers for
1090 multi-threaded programs</para>
1091 <indexterm zone="ch-system-glibc libthread_db">
1092 <primary sortas="c-libthread_db">libthread_db</primary>
1093 </indexterm>
1094 </listitem>
1095 </varlistentry>
1096
1097 <varlistentry id="libutil">
1098 <term><filename class="libraryfile">libutil</filename></term>
1099 <listitem>
1100 <para>Dummy library containing no functions. Previously contained
1101 code for <quote>standard</quote> functions used in
1102 many different Unix utilities. These functions are now in
1103 <filename class="libraryfile">libc</filename></para>
1104
1105 <indexterm zone="ch-system-glibc libutil">
1106 <primary sortas="c-libutil">libutil</primary>
1107 </indexterm>
1108 </listitem>
1109 </varlistentry>
1110
1111 </variablelist>
1112
1113 </sect2>
1114
1115</sect1>
Note: See TracBrowser for help on using the repository browser.