source: chapter08/glibc.xml@ adcaa44d

multilib
Last change on this file since adcaa44d was 70617e8, checked in by Thomas Trepl <thomas@…>, 14 months ago

Automatic merge of trunk into multilib

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