source: chapter08/glibc.xml@ 738a4c1

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

Automatic merge of trunk into multilib

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