source: chapter08/glibc.xml@ 72e10c9

multilib
Last change on this file since 72e10c9 was 3ecf6ae, checked in by Thomas Trepl <thomas@…>, 13 months ago

Merge branch 'trunk' into multilib

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