r166 - in trunk/BOOK: chapter05 chapter06

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Fri Feb 11 17:45:47 PST 2005


Author: manuel
Date: 2005-02-11 18:45:46 -0700 (Fri, 11 Feb 2005)
New Revision: 166

Added:
   trunk/BOOK/chapter05/glibc-headers.xml
   trunk/BOOK/chapter05/glibc.xml
   trunk/BOOK/chapter05/uclibc-headers.xml
   trunk/BOOK/chapter05/uclibc.xml
   trunk/BOOK/chapter06/glibc.xml
   trunk/BOOK/chapter06/uclibc.xml
Modified:
   trunk/BOOK/chapter05/chapter05.xml
   trunk/BOOK/chapter06/chapter06.xml
Log:
Migrated the Glibc and uClibc pages.

Modified: trunk/BOOK/chapter05/chapter05.xml
===================================================================
--- trunk/BOOK/chapter05/chapter05.xml	2005-02-11 21:06:19 UTC (rev 165)
+++ trunk/BOOK/chapter05/chapter05.xml	2005-02-12 01:45:46 UTC (rev 166)
@@ -10,13 +10,12 @@
 
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="introduction.xml"/>
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="linux-libc-headers.xml"/>
-<!--
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="glibc-headers.xml"/>
-<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="uclibc-headers.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="uclibc-headers.xml"/><!--
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="binutils-cross.xml"/>
-<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gcc-cross.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gcc-cross.xml"/>-->
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="glibc.xml"/>
-<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="uclibc.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="uclibc.xml"/><!--
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="adjusting.xml"/>
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="tcl.xml"/>
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="expect.xml"/>

Added: trunk/BOOK/chapter05/glibc-headers.xml
===================================================================
--- trunk/BOOK/chapter05/glibc-headers.xml	2005-02-11 21:06:19 UTC (rev 165)
+++ trunk/BOOK/chapter05/glibc-headers.xml	2005-02-12 01:45:46 UTC (rev 166)
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
+  <!ENTITY % general-entities SYSTEM "../general.ent">
+  %general-entities;
+]>
+<sect1 id="ch-tools-glibc-headers" role="wrap" condition="glibc">
+<title>Glibc-&glibc-version; Headers</title>
+<?dbhtml filename="glibc-headers.html"?>
+
+<indexterm zone="ch-tools-glibc-headers">
+<primary sortas="a-Glibc">Glibc</primary>
+<secondary>tools, headers</secondary></indexterm>
+
+<sect2 role="package"><title/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+href="../chapter06/glibc.xml" xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
+
+<segmentedlist>
+<segtitle>&buildtime;</segtitle>
+<segtitle>&diskspace;</segtitle>
+<seglistitem><seg>?? SBU</seg><seg>?? MB</seg></seglistitem>
+</segmentedlist>
+
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+href="../chapter06/glibc.xml" xpointer="xpointer(/sect1/sect2[1]/segmentedlist[2])"/>
+
+</sect2>
+
+<sect2 role="installation">
+<title>Installation of Glibc Headers</title>
+
+<para>This package is known to have issues when its default
+optimization flags (including the <parameter>-march</parameter> and
+<parameter>-mcpu</parameter> options) are changed. If any environment
+variables that override default optimizations have been defined, such
+as <envar>CFLAGS</envar> and <envar>CXXFLAGS</envar>,
+unset them when building Glibc.</para>
+
+<para>It should be noted that compiling Glibc in any way other than
+the method suggested in this book puts the stability of the system at
+risk.</para>
+
+<para>The Glibc documentation recommends building Glibc outside of the source
+directory in a dedicated build directory:</para>
+
+<screen><userinput>mkdir ../glibc-build
+cd ../glibc-build</userinput></screen>
+
+<para>Next, prepare Glibc for compilation:</para>
+
+<screen><userinput>../glibc-&glibc-version;/configure --prefix=/tools \
+    --host=${target} --without-cvs \
+    --disable-sanity-checks --with-headers=/tools/include</userinput></screen>
+
+<para>Build and install only the Glibc headers files:</para>
+
+<screen><userinput>make install-headers</userinput></screen>
+
+<para>Copy some headers that aren't installed by default</para>
+
+<screen><userinput>cp bits/stdio_lim.h /tools/include/bits
+touch /tools/include/gnu/stubs.h
+cp ../glibc-&glibc-version;/nptl/sysdeps/pthread/pthread.h /tools/include
+cp ../glibc-&glibc-version;/nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h \
+    /tools/include/bits</userinput></screen>
+
+</sect2>
+
+<sect2 role="content"><title/>
+<para>Details on this package are located in <xref
+linkend="contents-glibc" role="."/></para>
+</sect2>
+
+</sect1>
+


Property changes on: trunk/BOOK/chapter05/glibc-headers.xml
___________________________________________________________________
Name: svn:keywords
   + "Author Date Revision Id"

Added: trunk/BOOK/chapter05/glibc.xml
===================================================================
--- trunk/BOOK/chapter05/glibc.xml	2005-02-11 21:06:19 UTC (rev 165)
+++ trunk/BOOK/chapter05/glibc.xml	2005-02-12 01:45:46 UTC (rev 166)
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
+  <!ENTITY % general-entities SYSTEM "../general.ent">
+  %general-entities;
+]>
+<sect1 id="ch-tools-glibc" role="wrap" condition="glibc">
+<title>Glibc-&glibc-version;</title>
+<?dbhtml filename="glibc.html"?>
+
+<indexterm zone="ch-tools-glibc">
+<primary sortas="a-Glibc">Glibc</primary>
+<secondary>tools</secondary></indexterm>
+
+<sect2 role="package"><title/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+href="../chapter06/glibc.xml" xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
+
+<segmentedlist>
+<segtitle>&buildtime;</segtitle>
+<segtitle>&diskspace;</segtitle>
+<seglistitem><seg>?? SBU</seg><seg>?? MB</seg></seglistitem>
+</segmentedlist>
+
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+href="../chapter06/glibc.xml" xpointer="xpointer(/sect1/sect2[1]/segmentedlist[2])"/>
+
+</sect2>
+
+<sect2 role="installation">
+<title>Installation of Glibc</title>
+
+<para>This package is known to have issues when its default
+optimization flags (including the <parameter>-march</parameter> and
+<parameter>-mcpu</parameter> options) are changed. If any environment
+variables that override default optimizations have been defined, such
+as <envar>CFLAGS</envar> and <envar>CXXFLAGS</envar>,
+unset them when building Glibc.</para>
+
+<para>It should be noted that compiling Glibc in any way other than
+the method suggested in this book puts the stability of the system at
+risk.</para>
+
+<para>Be sure to unpack both Glibc and Glibc-Libidn packages before start the build. 
+Then, apply the patches:</para>
+
+<screen><userinput>patch -Np1 -i ../glibc-&glibc-version;-ssp_frandom-6.patch
+patch -Np1 -i ../glibc-&glibc-version;-pt_pax-1.patch
+patch -Np1 -i ../glibc-&glibc-version;-dl_execstack_PaX-1.patch</userinput></screen>
+
+<para>The first patch adds SSP functions to <filename class="libraryfile">libc.a</filename>
+and <filename class="libraryfile">libc.so</filename>. The pt_pax patch
+adds definitions for elf header markings related to the Binutils-pt_pax
+patch. The dl_execstack_PaX patch fixes a problem with the dynamic loader,
+which is needed for system running PaX kernels.</para>
+
+<para>The Glibc documentation recommends building Glibc outside of the source
+directory in a dedicated build directory:</para>
+
+<screen><userinput>mkdir ../glibc-build
+cd ../glibc-build</userinput></screen>
+
+<para>Create a default <filename>config.cache</filename> file to ... EDIT ME:</para>
+
+<screen><userinput>echo "libc_cv_forced_unwind=yes" > config.cache
+echo "libc_cv_c_cleanup=yes" >> config.cache</userinput></screen>
+
+<para>Prepare Glibc for compilation:</para>
+
+<screen><userinput>../glibc-&glibc-version;/configure --prefix=/tools \
+    --host=${target} --build=$(uname -m)-linux \
+    --disable-profile --enable-add-ons --with-binutils=/tools/bin \
+    --enable-kernel=2.6.0 --without-gd --without-cvs \
+    --with-headers=/tools/include --cache-file=config.cache</userinput></screen>
+
+<para>Compile the package:</para>
+
+<screen><userinput>make libgcc_eh="" gnulib="-lgcc" static-gnulib="-lgcc"</userinput></screen>
+
+<para>We need to use <parameter>libgcc_eh="" gnulib="-lgcc" static-gnulib="-lgcc"</parameter>
+because <filename class="libraryfile">libgcc_eh.a</filename> does not exist yet. Glibc does not 
+actually need <filename class="libraryfile">libgcc_eh</filename>, everything builds fine without it.</para>
+
+<para>To test the results, issue: <userinput>make libgcc_eh="" gnulib="-lgcc" static-gnulib="-lgcc"
+check</userinput>. All test should pass</para>
+
+<para>Install the package:</para>
+
+<screen><userinput>install -d /tools/etc
+touch /tools/etc/ld.so.conf
+make libgcc_eh="" gnulib="-lgcc" static-gnulib="-lgcc" install</userinput></screen>
+
+<para>If you want to install locales, then the following commands are suggested.
+If you want to install them all then replace the following commands with
+<userinput>make localedata/install-locales</userinput>.</para>
+
+<screen><userinput>install -d /tools/lib/locale
+localedef -i de_DE -f ISO-8859-1 de_DE
+localedef -i de_DE at euro -f ISO-8859-15 de_DE at euro
+localedef -i en_HK -f ISO-8859-1 en_HK
+localedef -i en_PH -f ISO-8859-1 en_PH 
+localedef -i en_US -f ISO-8859-1 en_US
+localedef -i es_MX -f ISO-8859-1 es_MX
+localedef -i fa_IR -f UTF-8 fa_IR
+localedef -i fr_FR -f ISO-8859-1 fr_FR
+localedef -i fr_FR at euro -f ISO-8859-15 fr_FR at euro
+localedef -i it_IT -f ISO-8859-1 it_IT
+localedef -i ja_JP -f EUC-JP ja_JP</userinput></screen>
+
+</sect2>
+
+<sect2 role="content"><title/>
+<para>Details on this package are located in <xref
+linkend="contents-glibc" role="."/></para>
+</sect2>
+
+</sect1>
+


Property changes on: trunk/BOOK/chapter05/glibc.xml
___________________________________________________________________
Name: svn:keywords
   + "Author Date Revision Id"

Added: trunk/BOOK/chapter05/uclibc-headers.xml
===================================================================
--- trunk/BOOK/chapter05/uclibc-headers.xml	2005-02-11 21:06:19 UTC (rev 165)
+++ trunk/BOOK/chapter05/uclibc-headers.xml	2005-02-12 01:45:46 UTC (rev 166)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
+  <!ENTITY % general-entities SYSTEM "../general.ent">
+  %general-entities;
+]>
+<sect1 id="ch-tools-uclibc-headers" role="wrap" condition="uclibc">
+<title>uClibc-&uclibc-version; Headers</title>
+<?dbhtml filename="uclibc-headers.html"?>
+
+<indexterm zone="ch-tools-uclibc-headers">
+<primary sortas="a-uClibc">uClibc</primary>
+<secondary>tools, headers</secondary></indexterm>
+
+<sect2 role="package"><title/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+href="../chapter06/uclibc.xml" xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
+
+<segmentedlist>
+<segtitle>&buildtime;</segtitle>
+<segtitle>&diskspace;</segtitle>
+<seglistitem><seg>?? SBU</seg><seg>?? MB</seg></seglistitem>
+</segmentedlist>
+
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+href="../chapter06/uclibc.xml" xpointer="xpointer(/sect1/sect2[1]/segmentedlist[2])"/>
+
+</sect2>
+
+<sect2 role="installation">
+<title>Installation of uClibc Headers</title>
+
+<para>Apply a patch that adds a generic configuration:</para>
+
+<screen><userinput>patch -Np1 -i ../uClibc-&uclibc-version;-config-1.patch</userinput></screen>
+
+<para>Prepare the uClibc headers:</para>
+
+<screen><userinput>make KERNEL_SOURCE=/tools headers</userinput></screen>
+
+<para>Before installing the libc headers, remove some symlinks pointing to
+kernel headers. This will prevent many warning messages and keep uClibc
+from clobbering the already installed kernel headers.</para>
+
+<screen><userinput>rm include/{asm,asm-generic,linux}</userinput></screen>
+
+<para>Install the headers:</para>
+
+<screen><userinput>make DEVEL_PREFIX=/tools/ install_dev</userinput></screen>
+
+</sect2>
+
+<sect2 role="content"><title/>
+<para>Details on this package are located in <xref
+linkend="contents-uclibc" role="."/></para>
+</sect2>
+
+</sect1>
+


Property changes on: trunk/BOOK/chapter05/uclibc-headers.xml
___________________________________________________________________
Name: svn:keywords
   + "Author Date Revision Id"

Added: trunk/BOOK/chapter05/uclibc.xml
===================================================================
--- trunk/BOOK/chapter05/uclibc.xml	2005-02-11 21:06:19 UTC (rev 165)
+++ trunk/BOOK/chapter05/uclibc.xml	2005-02-12 01:45:46 UTC (rev 166)
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
+  <!ENTITY % general-entities SYSTEM "../general.ent">
+  %general-entities;
+]>
+<sect1 id="ch-tools-uclibc" role="wrap" condition="uclibc">
+<title>uClibc-&uclibc-version;</title>
+<?dbhtml filename="uclibc.html"?>
+
+<indexterm zone="ch-tools-uclibc">
+<primary sortas="a-uClibc">uClibc</primary>
+<secondary>tools</secondary></indexterm>
+
+<sect2 role="package"><title/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+href="../chapter06/uclibc.xml" xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
+
+<segmentedlist>
+<segtitle>&buildtime;</segtitle>
+<segtitle>&diskspace;</segtitle>
+<seglistitem><seg>?? SBU</seg><seg>?? MB</seg></seglistitem>
+</segmentedlist>
+
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+href="../chapter06/uclibc.xml" xpointer="xpointer(/sect1/sect2[1]/segmentedlist[2])"/>
+
+</sect2>
+
+<sect2 role="installation">
+<title>Installation of uClibc</title>
+
+<para>The configuration of uClibc does not provide a way to define 
+<envar>HAVE_DEV_ERANDOM</envar> to use <filename
+class="devicefile">erandom</filename>. The following patch removes the <quote>ifdef</quote>
+ lines so it will use <filename class="devicefile">erandom</filename>:</para>
+
+<screen><userinput>patch -Np1 -i ../uClibc-&uclibc-version;-config-1.patch</userinput></screen>
+
+<para>UClibc uses the <parameter>-Os</parameter> optimization to reduce size. 
+The following command will remove this so uClibc uses <parameter>-O2</parameter>
+instead to optimize for speed:</para>
+
+<screen><userinput>sed -e 's/-Os,//' -i Rules.mak</userinput></screen>
+
+<para>Reset the installation paths:</para>
+
+<screen><userinput>sed -e \
+    's at .*SHARED_LIB_LOADER_P.*@SHARED_LIB_LOADER_PREFIX="/tools/lib"@g' \
+    -i .config
+sed -e 's at .*RUNTIME_PREFIX.*@RUNTIME_PREFIX="/tools"@g' -i .config
+sed -e 's at .*DEVEL_PREFIX.*@DEVEL_PREFIX="/tools/"@g' -i .config
+sed -e 's at .*KERNEL_SOURCE.*@KERNEL_SOURCE="/tools"@g' -i .config</userinput></screen>
+
+<para>Then build and install uClibc:</para>
+
+<screen><userinput>make CROSS=${target}- all</userinput></screen>
+
+<para>UClibc will clobber the previously installed libc headers. There is no
+practical way to prevent this, but no harm is done:</para>
+
+<screen><userinput>rm include/{asm,asm-generic,linux}</userinput></screen>
+
+<para>Install the package:</para>
+
+<screen><userinput>make install</userinput></screen>
+
+</sect2>
+
+<sect2 role="content"><title/>
+<para>Details on this package are located in <xref
+linkend="contents-uclibc" role="."/></para>
+</sect2>
+
+</sect1>
+


Property changes on: trunk/BOOK/chapter05/uclibc.xml
___________________________________________________________________
Name: svn:keywords
   + "Author Date Revision Id"

Modified: trunk/BOOK/chapter06/chapter06.xml
===================================================================
--- trunk/BOOK/chapter06/chapter06.xml	2005-02-11 21:06:19 UTC (rev 165)
+++ trunk/BOOK/chapter06/chapter06.xml	2005-02-12 01:45:46 UTC (rev 166)
@@ -18,9 +18,9 @@
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="pwdgroup.xml"/>
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="devices.xml"/>-->
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="linux-libc-headers.xml"/><!--
-<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="man-pages.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="man-pages.xml"/>-->
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="glibc.xml"/>
-<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="uclibc.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="uclibc.xml"/><!--
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="readjusting.xml"/>
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="binutils.xml"/>
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gcc.xml"/>

Added: trunk/BOOK/chapter06/glibc.xml
===================================================================
--- trunk/BOOK/chapter06/glibc.xml	2005-02-11 21:06:19 UTC (rev 165)
+++ trunk/BOOK/chapter06/glibc.xml	2005-02-12 01:45:46 UTC (rev 166)
@@ -0,0 +1,637 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
+  <!ENTITY % general-entities SYSTEM "../general.ent">
+  %general-entities;
+]>
+<sect1 id="ch-system-glibc" role="wrap" condition="glibc">
+<title>Glibc-&glibc-version;</title>
+<?dbhtml filename="glibc.html"?>
+
+<indexterm zone="ch-system-glibc">
+<primary sortas="a-Glibc">Glibc</primary>
+</indexterm>
+
+<sect2 role="package"><title/>
+<para>The Glibc package contains the main C library. This library provides 
+the basic routines for allocating memory, searching directories, opening and
+closing files, reading and writing files, string handling, pattern matching,
+arithmetic, and so on.</para>
+
+<segmentedlist>
+<segtitle>&buildtime;</segtitle>
+<segtitle>&diskspace;</segtitle>
+<seglistitem><seg>?? SBU</seg><seg>?? MB</seg></seglistitem>
+</segmentedlist>
+
+<segmentedlist>
+<segtitle>Glibc installation depends on</segtitle>
+<seglistitem><seg>Bash, Binutils, Coreutils, Diffutils,
+Gawk, GCC, Gettext, Grep, Make, Perl, Sed, and Texinfo</seg></seglistitem>
+</segmentedlist>
+
+</sect2>
+
+<sect2 role="installation">
+<title>Installation of Glibc</title>
+
+<para>This package is known to have issues when its default
+optimization flags (including the <parameter>-march</parameter> and
+<parameter>-mcpu</parameter> options) are changed. If any environment
+variables that override default optimizations have been defined, such
+as <envar>CFLAGS</envar> and <envar>CXXFLAGS</envar>,
+unset them when building Glibc.</para>
+
+<para>Be sure to unpack both Glibc and Glibc-Libidn packages, and for 
+the man pages Glibc-Linuxthreads, .before start the build. 
+Then, apply the patches:</para>
+
+<screen><userinput>patch -Np1 -i ../glibc-&glibc-version;-fstack_protector-1.patch
+patch -Np1 -i ../glibc-&glibc-version;-ssp_frandom-6.patch
+patch -Np1 -i ../glibc-&glibc-version;-pt_pax-1.patch
+patch -Np1 -i ../glibc-&glibc-version;-dl_execstack_PaX-1.patch</userinput></screen>
+
+<para>The fstack_protector patch adds <parameter>-fstack-protector-all</parameter>
+to selected utilities and libraries. <filename class="libraryfile">libc.so</filename>, 
+<filename class="libraryfile">ld.so</filename>, <filename 
+class="libraryfile">libbsd-compat.so</filename>, and other libraries which
+do not preload <filename class="libraryfile">libc.so</filename> are skipped. This patch 
+will work to override the <parameter>-fno-stack-protector</parameter> option used in 
+the <envar>CC</envar> environment variable below.</para>
+
+<para>The Glibc documentation recommends building Glibc outside of the source
+directory in a dedicated build directory:</para>
+
+<screen><userinput>mkdir ../glibc-build
+cd ../glibc-build</userinput></screen>
+
+<para>While Glibc can be built with <parameter>-pie</parameter> and 
+<parameter>-fPIC</parameter> (with a small patch) all of Glibc's utilities have 
+non-pic assembly code in them. If they're linked with <parameter>-pie</parameter>
+they will not be able to run on a kernel disallowing text relocation. Hence, there is no 
+advantage to using PIE in Glibc's build, but there are disadvantages. For this reason 
+the <parameter>-no-pie</parameter> option is added for Glibc so the applications 
+will be dynamically linked, this way they will be able to run on a kernel disallowing text 
+relocation. Glibc is aware of ld <parameter>-z now</parameter> and 
+<parameter>-z relro</parameter> options and it uses them where they are
+appropriate. Prepare Glibc for compilation:</para>
+
+<screen><userinput>env CC="gcc -fno-stack-protector -no-pie" \
+    ../glibc-&glibc-version;/configure --prefix=/usr \
+    --disable-profile --enable-add-ons \
+    --enable-kernel=2.6.0 --without-cvs \
+    --libexecdir=/usr/lib/glibc --enable-bind-now</userinput></screen>
+
+<para>Compile the package:</para>
+
+<screen><userinput>make</userinput></screen>
+
+<para>To test the results, issue:
+<userinput>make check</userinput>. They should all pass.</para>
+
+<para>Though it is a harmless message, the install stage of Glibc will
+complain about the absence of <filename>/etc/ld.so.conf</filename>.
+Prevent this warning with:</para>
+
+<screen><userinput>touch /etc/ld.so.conf</userinput></screen>
+
+<para>Install the package:</para>
+
+<screen><userinput>make install</userinput></screen>
+
+<para>Remove the static libs. GCC seems to need <filename 
+class="libraryfile">libc_nonshared.a</filename> to compile. <filename 
+class="libraryfile">libpthread_nonshared.a</filename> it needed to be able 
+to reinstall Glibc in the future. <filename class="libraryfile">libc.a</filename>
+is needed for GCC's test suite, and can be removed later:</para>
+
+<screen><userinput>rm /usr/lib/{libBrokenLocale,libanl,libbsd-compat}.a
+rm /usr/lib/{libcrypt,libdl,libg,libieee}.a
+rm /usr/lib/{libm,libmcheck,libnsl,libpthread,libresolv}.a
+rm /usr/lib/{librt,libutil,librpcsvc}.a</userinput></screen>
+
+<para>To install all the locales use <userinput>make localedata/install-locales</userinput>.
+To install just what the GCC test need use the following commands:</para>
+
+<screen><userinput>install -d /usr/lib/locale
+localedef -i de_DE -f ISO-8859-1 de_DE
+localedef -i de_DE at euro -f ISO-8859-15 de_DE at euro
+localedef -i en_HK -f ISO-8859-1 en_HK
+localedef -i en_PH -f ISO-8859-1 en_PH
+localedef -i en_US -f ISO-8859-1 en_US
+localedef -i es_MX -f ISO-8859-1 es_MX
+localedef -i fa_IR -f UTF-8 fa_IR
+localedef -i fr_FR -f ISO-8859-1 fr_FR
+localedef -i fr_FR at euro -f ISO-8859-15 fr_FR at euro
+localedef -i it_IT -f ISO-8859-1 it_IT
+localedef -i ja_JP -f EUC-JP ja_JP</userinput></screen>
+
+<para>Then install the man pages:</para>
+
+<screen><userinput>make -C ../glibc-&glibc-version;/linuxthreads/man
+make -C ../glibc-&glibc-version;/linuxthreads/man install</userinput></screen>
+
+</sect2>
+
+<sect2 id="conf-glibc" role="configuration"><title>Configuring Glibc</title>
+<indexterm zone="conf-glibc"><primary sortas="e-/etc/nsswitch.conf">/etc/nsswitch.conf</primary></indexterm>
+<indexterm zone="conf-glibc"><primary sortas="e-/etc/localtime">/etc/localtime</primary></indexterm>
+
+<para>The <filename>/etc/nsswitch.conf</filename> file needs to be
+created because, although Glibc provides defaults when this file is
+missing or corrupt, the Glibc defaults do not work well with
+networking. The time zone also needs to be set up.</para>
+
+<para>Create a new file <filename>/etc/nsswitch.conf</filename> by running the
+following:</para>
+
+<screen><userinput>cat > /etc/nsswitch.conf << "EOF"
+<literal># Begin /etc/nsswitch.conf
+
+passwd: files
+group: files
+shadow: files
+
+hosts: files dns
+networks: files
+
+protocols: files
+services: files
+ethers: files
+rpc: files
+
+# End /etc/nsswitch.conf</literal>
+EOF</userinput></screen>
+
+<para>To determine the local time zone, run the following script:</para>
+
+<screen><userinput>tzselect</userinput></screen>
+
+<para>After answering a few questions about the location, the script
+will output the name of the time zone (e.g.,
+<emphasis>EST5EDT</emphasis> or <emphasis>Canada/Eastern</emphasis>).
+Then create the <filename>/etc/localtime</filename> file by
+running:</para>
+
+<screen><userinput>cp --remove-destination /usr/share/zoneinfo/<replaceable>[xxx]</replaceable> \
+    /etc/localtime</userinput></screen>
+
+<para>Replace <replaceable>[xxx]</replaceable> with the name of the time zone that the
+<command>tzselect</command> provided (e.g., Canada/Eastern).</para>
+
+<para>The meaning of the cp option:</para>
+
+<variablelist>
+<varlistentry>
+<term><parameter>--remove-destination</parameter></term>
+<listitem><para>This is needed to force removal of the already
+existing symbolic link. The reason for copying the file instead of
+using a symlink is to cover the situation where <filename
+class="directory">/usr</filename> is on a separate partition. This
+could be important when booted into single user
+mode.</para></listitem>
+</varlistentry>
+</variablelist>
+
+</sect2>
+
+
+<sect2 id="conf-ld" role="configuration">
+<title>Configuring Dynamic Loader</title>
+<indexterm zone="conf-ld"><primary sortas="e-/etc/ld.so.conf">/etc/ld.so.conf</primary></indexterm>
+
+<para>By default, the dynamic loader (<filename
+class="libraryfile">/lib/ld-linux.so.2</filename>) searches through
+<filename class="directory">/lib</filename> and <filename
+class="directory">/usr/lib</filename> for dynamic libraries that are
+needed by programs as they are run. However, if there are libraries in
+directories other than <filename class="directory">/lib</filename> and
+<filename class="directory">/usr/lib</filename>, these need to be
+added to the <filename>/etc/ld.so.conf</filename> file in order
+for the dynamic loader to find them. Two directories that are commonly
+known to contain additional libraries are <filename
+class="directory">/usr/local/lib</filename> and <filename
+class="directory">/opt/lib</filename>, so add those directories to the
+dynamic loader's search path.</para>
+
+<para>Create a new file <filename>/etc/ld.so.conf</filename> by running the
+following:</para>
+
+<screen><userinput>cat > /etc/ld.so.conf << "EOF"
+<literal># Begin /etc/ld.so.conf
+
+/usr/local/lib
+
+# End /etc/ld.so.conf</literal>
+EOF</userinput></screen>
+
+</sect2>
+
+<sect2 id="contents-glibc" role="content"><title>Contents of Glibc</title>
+
+<segmentedlist>
+<segtitle>Installed programs</segtitle>
+<segtitle>Installed libraries</segtitle>
+<seglistitem><seg>catchsegv, gencat, getconf,
+getent, iconv, iconvconfig, ldconfig, ldd, lddlibc4, locale,
+localedef, mtrace, nscd, nscd_nischeck, pcprofiledump, pt_chown, rpcgen,
+rpcinfo, sln, sprof, tzselect, xtrace, zdump, and zic</seg>
+<seg>ld.so, libBrokenLocale.[a,so],
+libSegFault.so, libanl.[a,so], libbsd-compat.a, libc.[a,so], 
+libcrypt.[a,so], libdl.[a,so], libg.a, libieee.a, libm.[a,so], libmcheck.a,
+libmemusage.so, libnsl.a, libnss_compat.so, libnss_dns.so, libnss_files.so,
+libnss_hesiod.so, libnss_nis.so, libnss_nisplus.so, libpcprofile.so,
+libpthread.[a,so], libresolv.[a,so], librpcsvc.a, librt.[a,so],
+libthread_db.so, and libutil.[a,so]</seg></seglistitem>
+</segmentedlist>
+
+<variablelist><bridgehead renderas="sect3">Short Descriptions</bridgehead>
+<?dbfo list-presentation="list"?>
+
+<varlistentry id="catchsegv">
+<term><command>catchsegv</command></term>
+<listitem>
+<para>Can be used to create a stack trace when a program
+terminates with a segmentation fault</para>
+<indexterm zone="ch-system-glibc catchsegv"><primary sortas="b-catchsegv">catchsegv</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="gencat">
+<term><command>gencat</command></term>
+<listitem>
+<para>Generates message catalogues</para>
+<indexterm zone="ch-system-glibc gencat"><primary sortas="b-gencat">gencat</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="getconf">
+<term><command>getconf</command></term>
+<listitem>
+<para>Displays the system configuration values for file system specific variables</para>
+<indexterm zone="ch-system-glibc getconf"><primary sortas="b-getconf">getconf</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="getent">
+<term><command>getent</command></term>
+<listitem>
+<para>Gets entries from an administrative database</para>
+<indexterm zone="ch-system-glibc getent"><primary sortas="b-getent">getent</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="iconv">
+<term><command>iconv</command></term>
+<listitem>
+<para>Performs character set conversion</para>
+<indexterm zone="ch-system-glibc iconv"><primary sortas="b-iconv">iconv</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="iconvconfig">
+<term><command>iconvconfig</command></term>
+<listitem>
+<para>Creates fastloading <command>iconv</command> module configuration files</para>
+<indexterm zone="ch-system-glibc iconvconfig"><primary sortas="b-iconvconfig">iconvconfig</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="ldconfig">
+<term><command>ldconfig</command></term>
+<listitem>
+<para>Configures the dynamic linker runtime bindings</para>
+<indexterm zone="ch-system-glibc ldconfig"><primary sortas="b-ldconfig">ldconfig</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="ldd">
+<term><command>ldd</command></term>
+<listitem>
+<para>Reports which shared libraries are required
+by each given program or shared library</para>
+<indexterm zone="ch-system-glibc ldd"><primary sortas="b-ldd">ldd</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="lddlibc4">
+<term><command>lddlibc4</command></term>
+<listitem>
+<para>Assists <command>ldd</command> with object files</para>
+<indexterm zone="ch-system-glibc lddlibc4"><primary sortas="b-lddlibc4">lddlibc4</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="locale">
+<term><command>locale</command></term>
+<listitem>
+<para>Tells the compiler to enable or disable the use of POSIX locales
+for built-in operations</para>
+<indexterm zone="ch-system-glibc locale"><primary sortas="b-locale">locale</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="localedef">
+<term><command>localedef</command></term>
+<listitem>
+<para>Compiles locale specifications</para>
+<indexterm zone="ch-system-glibc localedef"><primary sortas="b-localedef">localedef</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="mtrace">
+<term><command>mtrace</command></term>
+<listitem>
+<para>Reads and interprets a memory trace file and
+ouputs a summary in human-readable format</para>
+<indexterm zone="ch-system-glibc mtrace"><primary sortas="b-mtrace">mtrace</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="nscd">
+<term><command>nscd</command></term>
+<listitem>
+<para>A daemon that provides a cache for the most common name
+service requests</para>
+<indexterm zone="ch-system-glibc nscd"><primary sortas="b-nscd">nscd</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="nscd_nischeck">
+<term><command>nscd_nischeck</command></term>
+<listitem>
+<para>Checks whether or not secure mode is necessary for NIS+ lookup</para>
+<indexterm zone="ch-system-glibc nscd_nischeck"><primary sortas="b-nscd_nischeck">nscd_nischeck</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="pcprofiledump">
+<term><command>pcprofiledump</command></term>
+<listitem>
+<para>Dumps information generated by PC profiling</para>
+<indexterm zone="ch-system-glibc pcprofiledump"><primary sortas="b-pcprofiledump">pcprofiledump</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="pt_chown">
+<term><command>pt_chown</command></term>
+<listitem>
+<para>A helper program for <command>grantpt</command> to set
+the owner, group and access permissions of a slave pseudo terminal</para>
+<indexterm zone="ch-system-glibc pt_chown"><primary sortas="b-pt_chown">pt_chown</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="rpcgen">
+<term><command>rpcgen</command></term>
+<listitem>
+<para>Generates C code to implement the Remote Procecure Call (RPC) protocol</para>
+<indexterm zone="ch-system-glibc rpcgen"><primary sortas="b-rpcgen">rpcgen</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="rpcinfo">
+<term><command>rpcinfo</command></term>
+<listitem>
+<para>Makes an RPC call to an RPC server</para>
+<indexterm zone="ch-system-glibc rpcinfo"><primary sortas="b-rpcinfo">rpcinfo</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="sln">
+<term><command>sln</command></term>
+<listitem>
+<para>A statically linked <command>ln</command> program</para>
+<indexterm zone="ch-system-glibc sln"><primary sortas="b-sln">sln</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="sprof">
+<term><command>sprof</command></term>
+<listitem>
+<para>Reads and displays shared object profiling data</para>
+<indexterm zone="ch-system-glibc sprof"><primary sortas="b-sprof">sprof</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="tzselect">
+<term><command>tzselect</command></term>
+<listitem>
+<para>Asks the user about the location of the
+system and reports the corresponding time zone description</para>
+<indexterm zone="ch-system-glibc tzselect"><primary sortas="b-tzselect">tzselect</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="xtrace">
+<term><command>xtrace</command></term>
+<listitem>
+<para>Traces the execution of a program by
+printing the currently executed function</para>
+<indexterm zone="ch-system-glibc xtrace"><primary sortas="b-xtrace">xtrace</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="zdump">
+<term><command>zdump</command></term>
+<listitem>
+<para>The time zone dumper</para>
+<indexterm zone="ch-system-glibc zdump"><primary sortas="b-zdump">zdump</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="zic">
+<term><command>zic</command></term>
+<listitem>
+<para>The time zone compiler</para>
+<indexterm zone="ch-system-glibc zic"><primary sortas="b-zic">zic</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="ld.so">
+<term><filename class="libraryfile">ld.so</filename></term>
+<listitem>
+<para>The helper program for shared library executables</para>
+<indexterm zone="ch-system-glibc ld.so"><primary sortas="c-ld.so">ld.so</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="libBrokenLocale">
+<term><filename class="libraryfile">libBrokenLocale</filename></term>
+<listitem>
+<para>Used by programs, such as Mozilla, to solve broken locales</para>
+<indexterm zone="ch-system-glibc libBrokenLocale"><primary sortas="c-libBrokenLocale">libBrokenLocale</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="libSegFault">
+<term><filename class="libraryfile">libSegFault</filename></term>
+<listitem>
+<para>The segmentation fault signal handler</para>
+<indexterm zone="ch-system-glibc libSegFault"><primary sortas="c-libSegFault">libSegFault</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="libanl">
+<term><filename class="libraryfile">libanl</filename></term>
+<listitem>
+<para>An asynchronous name lookup library</para>
+<indexterm zone="ch-system-glibc libanl"><primary sortas="c-libanl">libanl</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="libbsd-compat">
+<term><filename class="libraryfile">libbsd-compat</filename></term>
+<listitem>
+<para>Provides the portability needed
+in order to run certain Berkey Software Distribution (BSD) programs under Linux</para>
+<indexterm zone="ch-system-glibc libbsd-compat"><primary sortas="c-libbsd-compat">libbsd-compat</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="libc">
+<term><filename class="libraryfile">libc</filename></term>
+<listitem>
+<para>The main C library</para>
+<indexterm zone="ch-system-glibc libc"><primary sortas="c-libc">libc</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="libcrypt">
+<term><filename class="libraryfile">libcrypt</filename></term>
+<listitem>
+<para>The cryptography library</para>
+<indexterm zone="ch-system-glibc libcrypt"><primary sortas="c-libcrypt">libcrypt</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="libdl">
+<term><filename class="libraryfile">libdl</filename></term>
+<listitem>
+<para>The dynamic linking interface library</para>
+<indexterm zone="ch-system-glibc libdl"><primary sortas="c-libdl">libdl</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="libg">
+<term><filename class="libraryfile">libg</filename></term>
+<listitem>
+<para>A runtime library for <command>g++</command></para>
+<indexterm zone="ch-system-glibc libg"><primary sortas="c-libg">libg</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="libieee">
+<term><filename class="libraryfile">libieee</filename></term>
+<listitem>
+<para>The Institute of Electrical and Electronic Engineers (IEEE) floating point library</para>
+<indexterm zone="ch-system-glibc libieee"><primary sortas="c-libieee">libieee</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="libm">
+<term><filename class="libraryfile">libm</filename></term>
+<listitem>
+<para>The mathematical library</para>
+<indexterm zone="ch-system-glibc libm"><primary sortas="c-libm">libm</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="libmcheck">
+<term><filename class="libraryfile">libmcheck</filename></term>
+<listitem>
+<para>Contains code run at boot</para>
+<indexterm zone="ch-system-glibc libmcheck"><primary sortas="c-libmcheck">libmcheck</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="libmemusage">
+<term><filename class="libraryfile">libmemusage</filename></term>
+<listitem>
+<para>Used by <command>memusage</command> to help collect
+information about the memory usage of a program</para>
+<indexterm zone="ch-system-glibc libmemusage"><primary sortas="c-libmemusage">libmemusage</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="libnsl">
+<term><filename class="libraryfile">libnsl</filename></term>
+<listitem>
+<para>The network services library</para>
+<indexterm zone="ch-system-glibc libnsl"><primary sortas="c-libnsl">libnsl</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="libnss">
+<term><filename class="libraryfile">libnss</filename></term>
+<listitem>
+<para>The Name Service Switch libraries,
+containing functions for resolving host names, user names, group names,
+aliases, services, protocols, etc</para>
+<indexterm zone="ch-system-glibc libnss"><primary sortas="c-libnss">libnss</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="libpcprofile">
+<term><filename class="libraryfile">libpcprofile</filename></term>
+<listitem>
+<para>Contains profiling functions used
+to track the amount of CPU time spent in specific source code lines</para>
+<indexterm zone="ch-system-glibc libpcprofile"><primary sortas="c-libpcprofile">libpcprofile</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="libpthread">
+<term><filename class="libraryfile">libpthread</filename></term>
+<listitem>
+<para>The POSIX threads library</para>
+<indexterm zone="ch-system-glibc libpthread"><primary sortas="c-libpthread">libpthread</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="libresolv">
+<term><filename class="libraryfile">libresolv</filename></term>
+<listitem>
+<para>Contains functions for creating,
+sending, and interpreting packets to the Internet domain name servers</para>
+<indexterm zone="ch-system-glibc libresolv"><primary sortas="c-libresolv">libresolv</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="librpcsvc">
+<term><filename class="libraryfile">librpcsvc</filename></term>
+<listitem>
+<para>Contains functions providing miscellaneous RPC services</para>
+<indexterm zone="ch-system-glibc librpcsvc"><primary sortas="c-librpcsvc">librpcsvc</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="librt">
+<term><filename class="libraryfile">librt</filename></term>
+<listitem>
+<para>Contains functions providing most of the
+interfaces specified by the POSIX.1b Realtime Extension</para>
+<indexterm zone="ch-system-glibc librt"><primary sortas="c-librt">librt</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="libthread_db">
+<term><filename class="libraryfile">libthread_db</filename></term>
+<listitem>
+<para>Contains functions useful for
+building debuggers for multi-threaded programs</para>
+<indexterm zone="ch-system-glibc libthread_db"><primary sortas="c-libthread_db">libthread_db</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="libutil">
+<term><filename class="libraryfile">libutil</filename></term>
+<listitem>
+<para>Contains code for <quote>standard</quote> functions used in many different Unix utilities</para>
+<indexterm zone="ch-system-glibc libutil"><primary sortas="c-libutil">libutil</primary></indexterm>
+</listitem>
+</varlistentry>
+</variablelist>
+
+</sect2>
+
+</sect1>
\ No newline at end of file


Property changes on: trunk/BOOK/chapter06/glibc.xml
___________________________________________________________________
Name: svn:keywords
   + "Author Date Revision Id"

Added: trunk/BOOK/chapter06/uclibc.xml
===================================================================
--- trunk/BOOK/chapter06/uclibc.xml	2005-02-11 21:06:19 UTC (rev 165)
+++ trunk/BOOK/chapter06/uclibc.xml	2005-02-12 01:45:46 UTC (rev 166)
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
+  <!ENTITY % general-entities SYSTEM "../general.ent">
+  %general-entities;
+]>
+<sect1 id="ch-system-uclibc" role="wrap" condition="uclibc">
+<title>uClibc-&uclibc-version;</title>
+<?dbhtml filename="uclibc.html"?>
+
+<indexterm zone="ch-system-uclibc">
+<primary sortas="a-uClibc">uClibc</primary>
+</indexterm>
+
+<sect2 role="package"><title/>
+<para></para>
+
+<segmentedlist>
+<segtitle>&buildtime;</segtitle>
+<segtitle>&diskspace;</segtitle>
+<seglistitem><seg>?? SBU</seg><seg>?? MB</seg></seglistitem>
+</segmentedlist>
+
+<segmentedlist>
+<segtitle>uClibc installation depends on</segtitle>
+<seglistitem><seg>??, ??, ??</seg></seglistitem>
+</segmentedlist>
+
+</sect2>
+
+<sect2 role="installation">
+<title>Installation of uClibc</title>
+
+<para>First patch the <filename>ssp.c</filename> file:</para>
+
+<screen><userinput>patch -Np1 -i ../uClibc-&uclibc-version;-ssp-2.patch</userinput></screen>
+
+<para>Change the default optimization option so it uses <parameter>-O2</parameter>:</para>
+
+<screen><userinput>sed -e 's/-Os,//' -i Rules.mak</userinput></screen>
+
+<para>Next run menuconfig. This is very similar to the kernel's menuconfig.
+If you want to install locales you will need to fetch the 
+<filename>uClibc-locale-030818.tgz</filename> package from the uClibc.org website, and do:
+<userinput>install -m444 ../uClibc-locale-030818.tgz extra/locale/</userinput>.</para>
+
+<para><envar>UCLIBC_HAS_WCHAR</envar> is needed to build <command>g++</command>. 
+<envar>UCLIBC_HAS_RPC</envar> is needed to build Util-Linux 
+(<command>nfsmount</command>). <envar>UCLIBC_HAS_FULL_RPC</envar> is not 
+required, but Util-Linux will use pre-generated data if it is not enabled. 
+<envar>DO_C99_MATH</envar> is needed for Iproute2 for the <function>rint</function>(3) 
+function. <envar>UCLIBC_HAS_GLIBC_CUSTOM_PRINTF</envar> 
+(<filename class="headerfile">printf.h</filename>) is needed for some packages, like 
+Reiserfsprogs, but nothing in the base system. Enable all the security options, ignore the 
+SSP kill signal option (they all do the same thing). Use your own judgment for the rest. The
+<command>make defconfig</command> and <command>make allyesconfig</command>
+targets are not recommended.</para>
+
+<para>You can use the uClibc-config patch from chapter 5 if you do not want to
+answer any questions here.</para>
+
+<screen><userinput>make menuconfig</userinput></screen>
+
+<para>The run time path gets hard coded into <command>ldd</command>, and so on. 
+So we reset these installations paths now before compiling anything. While we're at it
+we can tell uClibc where to find the new kernel headers:</para>
+
+<screen><userinput>sed -e \
+    's at .*SHARED_LIB_LOADER_PREFIX.*@SHARED_LIB_LOADER_PREFIX="/lib"@g' \
+    -i .config
+sed -e 's at .*RUNTIME_PREFIX.*@RUNTIME_PREFIX="/"@g' -i .config
+sed -e 's at .*DEVEL_PREFIX.*@DEVEL_PREFIX="/usr/"@g' -i .config
+sed -e 's at .*KERNEL_SOURCE.*@KERNEL_SOURCE="/usr"@g' -i .config</userinput></screen>
+
+<para>Compile the package:</para>
+
+<screen><userinput>make
+make -C utils</userinput></screen>
+
+<para>To test the results, issue:
+<userinput>make -k -C test | tee make-test.log</userinput>. Some test may fail.</para>
+
+<para>Install the libraries, headers and utilities, but not the kernel headers. The 
+<command>readelf</command>(1) supplied with uClibc gets built but not installed:</para>
+
+<screen><userinput>rm include/{asm,asm-generic,linux}
+make install
+make -C utils install</userinput></screen>
+
+<para>Remove the static libs. Save <filename class="libraryfile">libc.a</filename>
+for GCC's tests:</para>
+
+<screen><userinput>rm /usr/lib/{libcrypt,libdl,libm,libnsl,libpthread}.a
+rm /usr/lib/{libresolv,librt,libutil}.a</userinput></screen>
+
+<para>Remove this symlinks:</para>
+
+<screen><userinput>rm /usr/lib/{libc_pic,libcrypt_pic,libdl_pic,libm_pic,libnsl_pic}.a
+rm /usr/lib/{libpthread_pic,libresolv_pic,librt_pic,libutil_pic}.a</userinput></screen>
+
+</sect2>
+
+
+<sect2 id="ld-conf" role="configuration">
+<title>Configuring Dynamic Loader</title>
+<indexterm zone="ld-conf"><primary sortas="e-/etc/ld.so.conf">/etc/ld.so.conf</primary></indexterm>
+
+<para>Create a new file <filename>/etc/ld.so.conf</filename> by running the
+following:</para>
+
+<screen><userinput>cat > ld.so.conf.new << "EOF"
+<literal># Begin /etc/ld.so.conf
+
+/usr/local/lib
+/opt/lib
+
+# End /etc/ld.so.conf</literal>
+EOF
+install -m644 ld.so.conf.new /etc/ld.so.conf</userinput></screen>
+
+</sect2>
+
+<sect2 id="conf-timezone" role="configuration"><title>Configuring the Timezone</title>
+<indexterm zone="conf-timezone"><primary sortas="e-/etc/TZ">/etc/TZ</primary></indexterm>
+
+<para>The system timezone is set with the <filename>/etc/TZ</filename> file. Users can 
+use the <envar>TZ</envar> environment variable for their local time. See <ulink
+url="http://www.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap08.html"/>
+and/or <ulink url="http://leaf.sourceforge.net/doc/guide/buci-tz.html#id2599108"/>
+for a more complete description. This example is for eastern standard time,
+and it will adjust by 1 hour automatically for daylight savings time:</para>
+
+<screen><userinput>echo "EST5EDT" > TZ.new
+install -m644 TZ.new /etc/TZ</userinput></screen>
+
+</sect2>
+
+
+<sect2 id="contents-uclibc" role="content"><title>Contents of uClibc</title>
+
+<segmentedlist>
+<segtitle>Installed programs</segtitle>
+<segtitle>Installed libraries</segtitle>
+<seglistitem><seg>??, ??, ??</seg>
+<seg>??, ??, ??</seg></seglistitem>
+</segmentedlist>
+
+<variablelist><bridgehead renderas="sect3">Short Descriptions</bridgehead>
+<?dbfo list-presentation="list"?>
+
+<varlistentry id="UNKNOW">
+<term><command>UNKNOW</command></term>
+<listitem>
+<para>EDIT ME.</para>
+<indexterm zone="ch-system-uclibc UNKNOW"><primary sortas="b-UNKNOW">UNKNOW</primary></indexterm>
+</listitem>
+</varlistentry>
+
+</variablelist>
+
+</sect2>
+
+</sect1>
+


Property changes on: trunk/BOOK/chapter06/uclibc.xml
___________________________________________________________________
Name: svn:keywords
   + "Author Date Revision Id"




More information about the hlfs-dev mailing list