source: chapter08/glibc.xml@ e6e2e70

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