source: chapter08/glibc.xml@ c5750ecf

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

Automatic merge of trunk into multilib

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