source: chapter08/glibc.xml@ fd6a5f8

ml-11.0 multilib
Last change on this file since fd6a5f8 was fd6a5f8, checked in by Thomas Trepl (Moody) <thomas@…>, 9 months ago

Automatic merge of trunk into multilib

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