source: chapter08/glibc.xml@ 219e404

multilib
Last change on this file since 219e404 was 5c258ba, checked in by Thomas Trepl <thomas@…>, 17 months ago

Automatic merge of trunk into multilib

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