source: chapter08/glibc.xml@ d8c9a43f

multilib
Last change on this file since d8c9a43f was d8c9a43f, checked in by Thomas Trepl (Moody) <thomas@…>, 20 months ago

Automatic merge of trunk into multilib

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