source: chapter08/glibc.xml@ dabd16b

ml-11.0 multilib
Last change on this file since dabd16b was cf65195, checked in by Thomas Trepl (Moody) <thomas@…>, 3 years ago

Automatic merge of trunk into multilib

  • Property mode set to 100644
File size: 41.4 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>Fix a bug that causes issues with chrooted applications:</para>
54
55 <screen><userinput remap="pre">sed -e '402a\ *result = local->data.services[database_index];' \
56 -i nss/nss_database.c</userinput></screen>
57
58 <para>Fix a build issue with gcc-11.1:</para>
59
60<screen><userinput remap="pre">sed 's/amx_/amx-/' -i sysdeps/x86/tst-cpu-features-supports.c</userinput></screen>
61
62 <para>The Glibc documentation recommends building Glibc
63 in a dedicated build directory:</para>
64
65<screen><userinput remap="pre">mkdir -v build
66cd build</userinput></screen>
67
68 <para>Prepare Glibc for compilation:</para>
69
70<screen arch="default"><userinput remap="configure">../configure --prefix=/usr \
71 --disable-werror \
72 --enable-kernel=&min-kernel; \
73 --enable-stack-protector=strong \
74 --with-headers=/usr/include \
75 libc_cv_slibdir=/usr/lib</userinput></screen>
76<screen arch="ml_32,ml_x32,ml_all"><userinput remap="configure">../configure --prefix=/usr \
77 --disable-werror \
78 --enable-kernel=&min-kernel; \
79 --enable-stack-protector=strong \
80 --with-headers=/usr/include \
81 --enable-multi-arch \
82 libc_cv_slibdir=/usr/lib</userinput></screen>
83
84 <variablelist>
85 <title>The meaning of the configure options:</title>
86
87 <varlistentry>
88 <term><parameter>--disable-werror</parameter></term>
89 <listitem>
90 <para>This option disables the -Werror option passed to
91 GCC. This is necessary for running the test suite.</para>
92 </listitem>
93 </varlistentry>
94
95 <varlistentry>
96 <term><parameter>--enable-kernel=&min-kernel;</parameter></term>
97 <listitem>
98 <para>This option tells the build system that this glibc may
99 be used with kernels as old as &min-kernel;. This means generating
100 workarounds in case a system call introduced in a later version
101 cannot be used.</para>
102 </listitem>
103 </varlistentry>
104
105 <varlistentry>
106 <term><parameter>--enable-stack-protector=strong</parameter></term>
107 <listitem>
108 <para>This option increases system security by adding
109 extra code to check for buffer overflows, such as stack
110 smashing attacks.</para>
111 </listitem>
112 </varlistentry>
113<!-- do we need this one? -->
114 <varlistentry>
115 <term><parameter>--with-headers=/usr/include</parameter></term>
116 <listitem>
117 <para>This option tells the build system where to find the
118 kernel API headers.</para>
119 </listitem>
120 </varlistentry>
121
122 <varlistentry>
123 <term><parameter>libc_cv_slibdir=/usr/lib</parameter></term>
124 <listitem>
125 <para>This variable sets the correct library for all
126 systems. We do not want lib64 to be used.</para>
127 </listitem>
128 </varlistentry>
129
130 <varlistentry>
131 <term><option>libc_cv_include_x86_isa_level=no</option></term>
132 <listitem>
133 <para>This disables <quote>x86 ISA needed</quote> property in
134 Glibc libraries. Use it <emphasis role="bold">if</emphasis>
135 you are building Glibc with <option>-march</option> option in
136 <envar>CFLAGS</envar>, to workaround an issue in Glibc-2.33
137 breaking it.</para>
138 </listitem>
139 </varlistentry>
140
141 </variablelist>
142
143 <para>Compile the package:</para>
144
145<screen><userinput remap="make">make</userinput></screen>
146
147 <important>
148 <para>In this section, the test suite for Glibc is considered critical.
149 Do not skip it under any circumstance.</para>
150 </important>
151
152 <para>Generally a few tests do not pass. The test failures listed below
153 are usually safe to ignore.</para>
154
155<!-- Use remap="make" here to work around a jhalfs issue. -->
156<!--<screen><userinput remap="make">case $(uname -m) in
157 i?86) ln -sfnv $PWD/elf/ld-linux.so.2 /lib ;;
158 x86_64) ln -sfnv $PWD/elf/ld-linux-x86-64.so.2 /lib ;;
159esac</userinput></screen>
160
161 <note><para>The symbolic link above is needed to run the tests at this
162 stage of building in the chroot environment. It will be overwritten
163 in the install phase below.</para></note>
164-->
165<screen><userinput remap="test">make check</userinput></screen>
166
167 <para>You may see some test failures. The Glibc test suite is
168 somewhat dependent on the host system. This is a list of the most common
169 issues seen for some versions of LFS:</para>
170
171 <itemizedlist>
172
173 <listitem>
174 <para><emphasis>io/tst-lchmod</emphasis>
175 is known to fail in the LFS chroot environment.</para>
176 </listitem>
177
178 <listitem>
179 <para><emphasis>misc/tst-ttyname</emphasis>
180 is known to fail in the LFS chroot environment.</para>
181 </listitem>
182
183 <listitem>
184 <!-- FIXME This currently tests SSBD and STIBP which do not exist
185 on non-intel, should be fixed in glibc-2.34
186 https://sourceware.org/pipermail/libc-alpha/2021-January/122171.html -->
187 <para><emphasis>elf/tst-cpu-features-cpuinfo</emphasis>
188 will fail on non-intel CPUs with this version of glibc.</para>
189 </listitem>
190
191 <listitem>
192 <para>The <emphasis>nss/tst-nss-files-hosts-multi</emphasis>
193 test may fail for reasons that have not been determined.</para>
194 </listitem>
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 generated 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 first
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.SIJS 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.SIJS 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">/lib</filename> and <filename
459 class="directory">/usr/lib</filename> for dynamic libraries that are
460 needed by programs as they are run. However, if there are libraries in
461 directories other than <filename class="directory">/lib</filename> and
462 <filename class="directory">/usr/lib</filename>, these need to be added
463 to the <filename>/etc/ld.so.conf</filename> file in order for the
464 dynamic loader to find them. Two directories that are commonly known
465 to contain additional libraries are <filename
466 class="directory">/usr/local/lib</filename> and <filename
467 class="directory">/opt/lib</filename>, so add those directories to the
468 dynamic loader's search path.</para>
469
470 <para>Create a new file <filename>/etc/ld.so.conf</filename> by running the
471 following:</para>
472
473<screen><userinput>cat &gt; /etc/ld.so.conf &lt;&lt; "EOF"
474<literal># Begin /etc/ld.so.conf
475/usr/local/lib
476/opt/lib
477</literal>
478EOF</userinput></screen>
479
480 <para>If desired, the dynamic loader can also search a directory and
481 include the contents of files found there. Generally the files in
482 this include directory are one line specifying the desired library path.
483 To add this capability run the following commands:</para>
484
485<screen role="nodump"><userinput>cat &gt;&gt; /etc/ld.so.conf &lt;&lt; "EOF"
486<literal># Add an include directory
487include /etc/ld.so.conf.d/*.conf
488</literal>
489EOF
490mkdir -pv /etc/ld.so.conf.d</userinput></screen>
491
492 </sect3>
493 </sect2>
494
495 <!-- - - - - - - - - - -->
496 <!-- Multilib - 32bit -->
497 <!-- - - - - - - - - - -->
498 <sect2 arch="ml_32,ml_all">
499 <title>Building Glibc - 32bit</title>
500
501 <para>Now recompile for m32. The extracted source can be
502 reused but needs to be cleaned before installing the m32
503 version of Glibc.</para>
504
505 <para>Clear the build directory and remove artefacts from
506 previous build:</para>
507
508<screen><userinput remap="pre">rm -rf ./*
509find .. -name "*.a" -delete</userinput></screen>
510
511 <para>Configure Glibc for m32 with the following commands:</para>
512
513<screen><userinput remap="configure">CC="gcc -m32" CXX="g++ -m32" \
514../configure \
515 --prefix=/usr \
516 --host=i686-pc-linux-gnu \
517 --build=$(../scripts/config.guess) \
518 --enable-kernel=&min-kernel; \
519 --with-headers=/usr/include \
520 --enable-multi-arch \
521 --libdir=/usr/lib32 \
522 --libexecdir=/usr/lib32 \
523 libc_cv_slibdir=/usr/lib32</userinput></screen>
524
525 <para>Compile the package:</para>
526
527<screen><userinput remap="make">make</userinput></screen>
528
529 <para>Install the package:</para>
530
531<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
532cp -a DESTDIR/usr/lib32/* /usr/lib32/
533install -vm644 DESTDIR/usr/include/gnu/{lib-names,stubs}-32.h \
534 /usr/include/gnu/</userinput></screen>
535<!-- no longer required as they are created in chap5
536ln -svf ../lib32/ld-linux.so.2 /lib/ld-linux.so.2
537-->
538
539 <para>Add the library name to the dynamic loader config:</para>
540
541<screen role="install"><userinput>echo "/usr/lib32" &gt;&gt; /etc/ld.so.conf</userinput></screen>
542
543 <caution>
544 <para>At this point, it is imperative to stop and ensure that the basic
545 functions (compiling and linking) of the new toolchain are working as
546 expected. To perform a sanity check, run the following commands:</para>
547
548<screen><userinput>echo 'int main(){}' &gt; dummy.c
549gcc -m32 dummy.c
550readelf -l a.out | grep '/ld-linux'</userinput></screen>
551
552 <para>If everything is working correctly, there should be no errors,
553 and the output of the last command will be of the form:</para>
554
555<screen><computeroutput>[Requesting program interpreter: /lib/ld-linux.so.2]</computeroutput></screen>
556
557 <para>If the output is not shown as above or there was no output at all,
558 then something is wrong. Investigate and retrace the steps to find out
559 where the problem is and correct it. This issue must be resolved before
560 continuing on.</para>
561
562 <para>Once all is well, clean up the test files:</para>
563
564<screen><userinput>rm -v dummy.c a.out</userinput></screen>
565
566 </caution>
567
568 </sect2><!-- m32 -->
569
570 <!-- - - - - - - - - - -->
571 <!-- Multilib - x32bit -->
572 <!-- - - - - - - - - - -->
573
574 <sect2 arch="ml_x32,ml_all">
575 <title>Building Glibc - x32bit</title>
576
577 <para>Now recompile for mx32. The extracted source can be
578 reused but needs to be cleaned before installing the mx32
579 version of Glibc.</para>
580
581 <para>Clear the build directory and remove artefacts from
582 previous build:</para>
583
584<screen><userinput remap="pre">rm -rf ./*
585find .. -name "*.a" -delete</userinput></screen>
586
587 <para>Configure Glibc for mx32 with the following commands:</para>
588
589<screen><userinput remap="configure">CC="gcc -mx32" CXX="g++ -mx32" \
590../configure \
591 --prefix=/usr \
592 --host=x86_64-pc-linux-gnux32 \
593 --build=$(../scripts/config.guess) \
594 --enable-kernel=&min-kernel; \
595 --with-headers=/usr/include \
596 --enable-multi-arch \
597 --libdir=/usr/libx32 \
598 --libexecdir=/usr/libx32 \
599 libc_cv_slibdir=/usr/libx32</userinput></screen>
600
601 <para>Compile the package:</para>
602
603<screen><userinput remap="make">make</userinput></screen>
604
605 <para>Install the package:</para>
606
607<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
608cp -a DESTDIR/usr/libx32/* /usr/libx32/
609install -vm644 DESTDIR/usr/include/gnu/{lib-names,stubs}-x32.h \
610 /usr/include/gnu/</userinput></screen>
611<!-- no longer required as they are created in chap5
612ln -svf ../libx32/ld-linux-x32.so.2 /lib/ld-linux-x32.so.2
613-->
614 <para>Add the library name to the dynamic loader config:</para>
615
616<screen role="install"><userinput>echo "/usr/libx32" &gt;&gt; /etc/ld.so.conf</userinput></screen>
617
618 <caution>
619 <para>At this point, it is imperative to stop and ensure that the basic
620 functions (compiling and linking) of the new toolchain are working as
621 expected. To perform a sanity check, run the following commands:</para>
622
623<screen><userinput>echo 'int main(){}' &gt; dummy.c
624gcc -mx32 dummy.c
625readelf -l a.out | grep '/ld-linux-x32'</userinput></screen>
626
627 <para>If everything is working correctly, there should be no errors,
628 and the output of the last command will be of the form:</para>
629
630<screen><computeroutput>[Requesting program interpreter: /libx32/ld-linux-x32.so.2]</computeroutput></screen>
631
632 <para>If the output is not shown as above or there was no output at all,
633 then something is wrong. Investigate and retrace the steps to find out
634 where the problem is and correct it. This issue must be resolved before
635 continuing on.</para>
636
637 <para>Once all is well, clean up the test files:</para>
638
639<screen><userinput>rm -v dummy.c a.out</userinput></screen>
640
641 </caution>
642
643 </sect2><!-- mx32 -->
644
645 <sect2 id="contents-glibc" role="content">
646 <title>Contents of Glibc</title>
647
648 <segmentedlist>
649 <segtitle>Installed programs</segtitle>
650 <segtitle>Installed libraries</segtitle>
651 <segtitle>Installed directories</segtitle>
652
653 <seglistitem>
654 <seg>catchsegv, gencat, getconf, getent, iconv, iconvconfig, ldconfig,
655 ldd, lddlibc4, locale, localedef, makedb, mtrace, nscd,
656 pcprofiledump, pldd, sln, sotruss, sprof, tzselect, xtrace,
657 zdump, and zic</seg>
658 <seg>ld-&glibc-version;.so, libBrokenLocale.{a,so}, libSegFault.so, libanl.{a,so},
659 libc.{a,so}, libc_nonshared.a,
660 libcrypt.{a,so}, libdl.{a,so}, libg.a, libm.{a,so},
661 libmcheck.a, libmemusage.so, libmvec.{a,so}, libnsl.{a,so},
662 libnss_compat.so, libnss_dns.so, libnss_files.so, libnss_hesiod.so,
663 libpcprofile.so, libpthread.{a,so},
664 libpthread_nonshared.a, libresolv.{a,so}, librt.{a,so},
665 libthread_db.so, and libutil.{a,so}</seg>
666 <seg>/usr/include/arpa, /usr/include/bits, /usr/include/gnu,
667 /usr/include/net, /usr/include/netash, /usr/include/netatalk,
668 /usr/include/netax25, /usr/include/neteconet, /usr/include/netinet,
669 /usr/include/netipx, /usr/include/netiucv, /usr/include/netpacket,
670 /usr/include/netrom, /usr/include/netrose, /usr/include/nfs,
671 /usr/include/protocols, /usr/include/rpc,
672 /usr/include/sys, /usr/lib/audit, /usr/lib/gconv, /usr/lib/locale,
673 /usr/libexec/getconf, /usr/share/i18n, /usr/share/zoneinfo,
674 /var/cache/nscd, and /var/lib/nss_db</seg>
675 </seglistitem>
676 </segmentedlist>
677
678 <variablelist>
679 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
680 <?dbfo list-presentation="list"?>
681 <?dbhtml list-presentation="table"?>
682
683 <varlistentry id="catchsegv">
684 <term><command>catchsegv</command></term>
685 <listitem>
686 <para>Can be used to create a stack trace when a program
687 terminates with a segmentation fault</para>
688 <indexterm zone="ch-system-glibc catchsegv">
689 <primary sortas="b-catchsegv">catchsegv</primary>
690 </indexterm>
691 </listitem>
692 </varlistentry>
693
694 <varlistentry id="gencat">
695 <term><command>gencat</command></term>
696 <listitem>
697 <para>Generates message catalogues</para>
698 <indexterm zone="ch-system-glibc gencat">
699 <primary sortas="b-gencat">gencat</primary>
700 </indexterm>
701 </listitem>
702 </varlistentry>
703
704 <varlistentry id="getconf">
705 <term><command>getconf</command></term>
706 <listitem>
707 <para>Displays the system configuration values for file system
708 specific variables</para>
709 <indexterm zone="ch-system-glibc getconf">
710 <primary sortas="b-getconf">getconf</primary>
711 </indexterm>
712 </listitem>
713 </varlistentry>
714
715 <varlistentry id="getent">
716 <term><command>getent</command></term>
717 <listitem>
718 <para>Gets entries from an administrative database</para>
719 <indexterm zone="ch-system-glibc getent">
720 <primary sortas="b-getent">getent</primary>
721 </indexterm>
722 </listitem>
723 </varlistentry>
724
725 <varlistentry id="iconv">
726 <term><command>iconv</command></term>
727 <listitem>
728 <para>Performs character set conversion</para>
729 <indexterm zone="ch-system-glibc iconv">
730 <primary sortas="b-iconv">iconv</primary>
731 </indexterm>
732 </listitem>
733 </varlistentry>
734
735 <varlistentry id="iconvconfig">
736 <term><command>iconvconfig</command></term>
737 <listitem>
738 <para>Creates fastloading <command>iconv</command> module configuration
739 files</para>
740 <indexterm zone="ch-system-glibc iconvconfig">
741 <primary sortas="b-iconvconfig">iconvconfig</primary>
742 </indexterm>
743 </listitem>
744 </varlistentry>
745
746 <varlistentry id="ldconfig">
747 <term><command>ldconfig</command></term>
748 <listitem>
749 <para>Configures the dynamic linker runtime bindings</para>
750 <indexterm zone="ch-system-glibc ldconfig">
751 <primary sortas="b-ldconfig">ldconfig</primary>
752 </indexterm>
753 </listitem>
754 </varlistentry>
755
756 <varlistentry id="ldd">
757 <term><command>ldd</command></term>
758 <listitem>
759 <para>Reports which shared libraries are required
760 by each given program or shared library</para>
761 <indexterm zone="ch-system-glibc ldd">
762 <primary sortas="b-ldd">ldd</primary>
763 </indexterm>
764 </listitem>
765 </varlistentry>
766
767 <varlistentry id="lddlibc4">
768 <term><command>lddlibc4</command></term>
769 <listitem>
770 <para>Assists <command>ldd</command> with object files</para>
771 <indexterm zone="ch-system-glibc lddlibc4">
772 <primary sortas="b-lddlibc4">lddlibc4</primary>
773 </indexterm>
774 </listitem>
775 </varlistentry>
776
777 <varlistentry id="locale">
778 <term><command>locale</command></term>
779 <listitem>
780 <para>Prints various information about the current locale</para>
781 <indexterm zone="ch-system-glibc locale">
782 <primary sortas="b-locale">locale</primary>
783 </indexterm>
784 </listitem>
785 </varlistentry>
786
787 <varlistentry id="localedef">
788 <term><command>localedef</command></term>
789 <listitem>
790 <para>Compiles locale specifications</para>
791 <indexterm zone="ch-system-glibc localedef">
792 <primary sortas="b-localedef">localedef</primary>
793 </indexterm>
794 </listitem>
795 </varlistentry>
796
797 <varlistentry id="makedb">
798 <term><command>makedb</command></term>
799 <listitem>
800 <para>Creates a simple database from textual input</para>
801 <indexterm zone="ch-system-glibc makedb">
802 <primary sortas="b-makedb">makedb</primary>
803 </indexterm>
804 </listitem>
805 </varlistentry>
806
807 <varlistentry id="mtrace">
808 <term><command>mtrace</command></term>
809 <listitem>
810 <para>Reads and interprets a memory trace file and displays a summary
811 in human-readable format</para>
812 <indexterm zone="ch-system-glibc mtrace">
813 <primary sortas="b-mtrace">mtrace</primary>
814 </indexterm>
815 </listitem>
816 </varlistentry>
817
818 <varlistentry id="nscd">
819 <term><command>nscd</command></term>
820 <listitem>
821 <para>A daemon that provides a cache for the most common name
822 service requests</para>
823 <indexterm zone="ch-system-glibc nscd">
824 <primary sortas="b-nscd">nscd</primary>
825 </indexterm>
826 </listitem>
827 </varlistentry>
828
829 <varlistentry id="pcprofiledump">
830 <term><command>pcprofiledump</command></term>
831 <listitem>
832 <para>Dump information generated by PC profiling</para>
833 <indexterm zone="ch-system-glibc pcprofiledump">
834 <primary sortas="b-pcprofiledump">pcprofiledump</primary>
835 </indexterm>
836 </listitem>
837 </varlistentry>
838
839 <varlistentry id="pldd">
840 <term><command>pldd</command></term>
841 <listitem>
842 <para>Lists dynamic shared objects used by running processes</para>
843 <indexterm zone="ch-system-glibc pldd">
844 <primary sortas="b-pldd">pldd</primary>
845 </indexterm>
846 </listitem>
847 </varlistentry>
848
849 <varlistentry id="sln">
850 <term><command>sln</command></term>
851 <listitem>
852 <para>A statically linked <command>ln</command> program</para>
853 <indexterm zone="ch-system-glibc sln">
854 <primary sortas="b-sln">sln</primary>
855 </indexterm>
856 </listitem>
857 </varlistentry>
858
859 <varlistentry id="sotruss">
860 <term><command>sotruss</command></term>
861 <listitem>
862 <para>Traces shared library procedure calls of a specified command</para>
863 <indexterm zone="ch-system-glibc sotruss">
864 <primary sortas="b-sotruss">sotruss</primary>
865 </indexterm>
866 </listitem>
867 </varlistentry>
868
869 <varlistentry id="sprof">
870 <term><command>sprof</command></term>
871 <listitem>
872 <para>Reads and displays shared object profiling data</para>
873 <indexterm zone="ch-system-glibc sprof">
874 <primary sortas="b-sprof">sprof</primary>
875 </indexterm>
876 </listitem>
877 </varlistentry>
878
879 <varlistentry id="tzselect">
880 <term><command>tzselect</command></term>
881 <listitem>
882 <para>Asks the user about the location of the system and reports
883 the corresponding time zone description</para>
884 <indexterm zone="ch-system-glibc tzselect">
885 <primary sortas="b-tzselect">tzselect</primary>
886 </indexterm>
887 </listitem>
888 </varlistentry>
889
890 <varlistentry id="xtrace">
891 <term><command>xtrace</command></term>
892 <listitem>
893 <para>Traces the execution of a program by printing the currently
894 executed function</para>
895 <indexterm zone="ch-system-glibc xtrace">
896 <primary sortas="b-xtrace">xtrace</primary>
897 </indexterm>
898 </listitem>
899 </varlistentry>
900
901 <varlistentry id="zdump">
902 <term><command>zdump</command></term>
903 <listitem>
904 <para>The time zone dumper</para>
905 <indexterm zone="ch-system-glibc zdump">
906 <primary sortas="b-zdump">zdump</primary>
907 </indexterm>
908 </listitem>
909 </varlistentry>
910
911 <varlistentry id="zic">
912 <term><command>zic</command></term>
913 <listitem>
914 <para>The time zone compiler</para>
915 <indexterm zone="ch-system-glibc zic">
916 <primary sortas="b-zic">zic</primary>
917 </indexterm>
918 </listitem>
919 </varlistentry>
920
921 <varlistentry id="ld.so">
922 <term><filename class="libraryfile">ld-&glibc-version;.so</filename></term>
923 <listitem>
924 <para>The helper program for shared library executables</para>
925 <indexterm zone="ch-system-glibc ld.so">
926 <primary sortas="c-ld.so">ld-&glibc-version;.so</primary>
927 </indexterm>
928 </listitem>
929 </varlistentry>
930
931 <varlistentry id="libBrokenLocale">
932 <term><filename class="libraryfile">libBrokenLocale</filename></term>
933 <listitem>
934 <para>Used internally by Glibc as a gross hack to get broken programs
935 (e.g., some Motif applications) running. See comments in
936 <filename>glibc-&glibc-version;/locale/broken_cur_max.c</filename>
937 for more information</para>
938 <indexterm zone="ch-system-glibc libBrokenLocale">
939 <primary sortas="c-libBrokenLocale">libBrokenLocale</primary>
940 </indexterm>
941 </listitem>
942 </varlistentry>
943
944 <varlistentry id="libSegFault">
945 <term><filename class="libraryfile">libSegFault</filename></term>
946 <listitem>
947 <para>The segmentation fault signal handler, used by
948 <command>catchsegv</command></para>
949 <indexterm zone="ch-system-glibc libSegFault">
950 <primary sortas="c-libSegFault">libSegFault</primary>
951 </indexterm>
952 </listitem>
953 </varlistentry>
954
955 <varlistentry id="libanl">
956 <term><filename class="libraryfile">libanl</filename></term>
957 <listitem>
958 <para>An asynchronous name lookup library</para>
959 <indexterm zone="ch-system-glibc libanl">
960 <primary sortas="c-libanl">libanl</primary>
961 </indexterm>
962 </listitem>
963 </varlistentry>
964
965 <varlistentry id="libc">
966 <term><filename class="libraryfile">libc</filename></term>
967 <listitem>
968 <para>The main C library</para>
969 <indexterm zone="ch-system-glibc libc">
970 <primary sortas="c-libc">libc</primary>
971 </indexterm>
972 </listitem>
973 </varlistentry>
974
975 <varlistentry id="libcrypt">
976 <term><filename class="libraryfile">libcrypt</filename></term>
977 <listitem>
978 <para>The cryptography library</para>
979 <indexterm zone="ch-system-glibc libcrypt">
980 <primary sortas="c-libcrypt">libcrypt</primary>
981 </indexterm>
982 </listitem>
983 </varlistentry>
984
985 <varlistentry id="libdl">
986 <term><filename class="libraryfile">libdl</filename></term>
987 <listitem>
988 <para>The dynamic linking interface library</para>
989 <indexterm zone="ch-system-glibc libdl">
990 <primary sortas="c-libdl">libdl</primary>
991 </indexterm>
992 </listitem>
993 </varlistentry>
994
995 <varlistentry id="libg">
996 <term><filename class="libraryfile">libg</filename></term>
997 <listitem>
998 <para>Dummy library containing no functions. Previously was a runtime
999 library for <command>g++</command></para>
1000 <indexterm zone="ch-system-glibc libg">
1001 <primary sortas="c-libg">libg</primary>
1002 </indexterm>
1003 </listitem>
1004 </varlistentry>
1005
1006 <varlistentry id="libm">
1007 <term><filename class="libraryfile">libm</filename></term>
1008 <listitem>
1009 <para>The mathematical library</para>
1010 <indexterm zone="ch-system-glibc libm">
1011 <primary sortas="c-libm">libm</primary>
1012 </indexterm>
1013 </listitem>
1014 </varlistentry>
1015
1016 <varlistentry id="libmcheck">
1017 <term><filename class="libraryfile">libmcheck</filename></term>
1018 <listitem>
1019 <para>Turns on memory allocation checking when linked to</para>
1020 <indexterm zone="ch-system-glibc libmcheck">
1021 <primary sortas="c-libmcheck">libmcheck</primary>
1022 </indexterm>
1023 </listitem>
1024 </varlistentry>
1025
1026 <varlistentry id="libmemusage">
1027 <term><filename class="libraryfile">libmemusage</filename></term>
1028 <listitem>
1029 <para>Used by <command>memusage</command> to help collect
1030 information about the memory usage of a program</para>
1031 <indexterm zone="ch-system-glibc libmemusage">
1032 <primary sortas="c-libmemusage">libmemusage</primary>
1033 </indexterm>
1034 </listitem>
1035 </varlistentry>
1036
1037 <varlistentry id="libnsl">
1038 <term><filename class="libraryfile">libnsl</filename></term>
1039 <listitem>
1040 <para>The network services library</para>
1041 <indexterm zone="ch-system-glibc libnsl">
1042 <primary sortas="c-libnsl">libnsl</primary>
1043 </indexterm>
1044 </listitem>
1045 </varlistentry>
1046
1047 <varlistentry id="libnss">
1048 <term><filename class="libraryfile">libnss</filename></term>
1049 <listitem>
1050 <para>The Name Service Switch libraries, containing functions for
1051 resolving host names, user names, group names, aliases, services,
1052 protocols, etc.</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>The POSIX threads library</para>
1073 <indexterm zone="ch-system-glibc libpthread">
1074 <primary sortas="c-libpthread">libpthread</primary>
1075 </indexterm>
1076 </listitem>
1077 </varlistentry>
1078
1079 <varlistentry id="libresolv">
1080 <term><filename class="libraryfile">libresolv</filename></term>
1081 <listitem>
1082 <para>Contains functions for creating, sending, and interpreting
1083 packets to the Internet domain name servers</para>
1084 <indexterm zone="ch-system-glibc libresolv">
1085 <primary sortas="c-libresolv">libresolv</primary>
1086 </indexterm>
1087 </listitem>
1088 </varlistentry>
1089
1090 <varlistentry id="librt">
1091 <term><filename class="libraryfile">librt</filename></term>
1092 <listitem>
1093 <para>Contains functions providing most of the interfaces specified
1094 by the POSIX.1b Realtime Extension</para>
1095 <indexterm zone="ch-system-glibc librt">
1096 <primary sortas="c-librt">librt</primary>
1097 </indexterm>
1098 </listitem>
1099 </varlistentry>
1100
1101 <varlistentry id="libthread_db">
1102 <term><filename class="libraryfile">libthread_db</filename></term>
1103 <listitem>
1104 <para>Contains functions useful for building debuggers for
1105 multi-threaded programs</para>
1106 <indexterm zone="ch-system-glibc libthread_db">
1107 <primary sortas="c-libthread_db">libthread_db</primary>
1108 </indexterm>
1109 </listitem>
1110 </varlistentry>
1111
1112 <varlistentry id="libutil">
1113 <term><filename class="libraryfile">libutil</filename></term>
1114 <listitem>
1115 <para>Contains code for <quote>standard</quote> functions used in
1116 many different Unix utilities</para>
1117 <indexterm zone="ch-system-glibc libutil">
1118 <primary sortas="c-libutil">libutil</primary>
1119 </indexterm>
1120 </listitem>
1121 </varlistentry>
1122
1123 </variablelist>
1124
1125 </sect2>
1126
1127</sect1>
Note: See TracBrowser for help on using the repository browser.