source: chapter08/glibc.xml@ d4b5218

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

Merge

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