source: chapter08/glibc.xml@ 1f9e7d5

multilib xry111/multilib
Last change on this file since 1f9e7d5 was 607ca5a4, checked in by Thomas Trepl <thomas@…>, 20 months ago

Automatic merge of trunk into multilib

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