| [3f8be484] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
 | 
|---|
 | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
 | 
|---|
 | 3 |   "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
 | 
|---|
 | 4 |   <!ENTITY % general-entities SYSTEM "../../general.ent">
 | 
|---|
 | 5 |   %general-entities;
 | 
|---|
 | 6 | ]>
 | 
|---|
 | 7 | 
 | 
|---|
 | 8 | <sect1 id="ch-cross-tools-glibc" role="wrap">
 | 
|---|
 | 9 |   <?dbhtml filename="glibc.html"?>
 | 
|---|
 | 10 | 
 | 
|---|
 | 11 |   <title>Glibc-&glibc-version;</title>
 | 
|---|
 | 12 | 
 | 
|---|
 | 13 |   <indexterm zone="ch-cross-tools-glibc">
 | 
|---|
 | 14 |     <primary sortas="a-Glibc">Glibc</primary>
 | 
|---|
 | 15 |     <secondary>cross tools</secondary>
 | 
|---|
 | 16 |   </indexterm>
 | 
|---|
 | 17 | 
 | 
|---|
| [cf66ceae] | 18 |   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
 | 
|---|
 | 19 |   href="../../final-system/common/glibc.xml"
 | 
|---|
 | 20 |   xpointer="xpointer(//*[@role='package'])"/>
 | 
|---|
| [3f8be484] | 21 | 
 | 
|---|
 | 22 |   <sect2 role="installation">
 | 
|---|
 | 23 |     <title>Installation of Glibc</title>
 | 
|---|
 | 24 | 
 | 
|---|
 | 25 |     <para os="da">It should be noted that compiling Glibc in any way other than
 | 
|---|
 | 26 |     the method suggested in this book puts the stability of the system at
 | 
|---|
 | 27 |     risk.</para>
 | 
|---|
 | 28 | 
 | 
|---|
 | 29 |     <para os="db">We will disable the linking to
 | 
|---|
 | 30 |     <filename>libgcc_eh</filename>:</para>
 | 
|---|
 | 31 | 
 | 
|---|
 | 32 | <screen os="dc"><userinput>patch -Np1 -i ../&glibc-libgcc_eh-patch;</userinput></screen>
 | 
|---|
 | 33 | 
 | 
|---|
 | 34 |     <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
 | 
|---|
 | 35 |     href="../../final-system/common/glibc.xml"
 | 
|---|
 | 36 |     xpointer="xpointer(//*[@os='c'])"/>
 | 
|---|
 | 37 | 
 | 
|---|
 | 38 |     <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
 | 
|---|
 | 39 |     href="../../final-system/common/glibc.xml"
 | 
|---|
 | 40 |     xpointer="xpointer(//*[@os='d'])"/>
 | 
|---|
 | 41 | 
 | 
|---|
 | 42 |     <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
 | 
|---|
 | 43 |     href="../../final-system/common/glibc.xml"
 | 
|---|
 | 44 |     xpointer="xpointer(//*[@os='e'])"/>
 | 
|---|
 | 45 | 
 | 
|---|
 | 46 |     <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
 | 
|---|
 | 47 |     href="../../final-system/common/glibc.xml"
 | 
|---|
 | 48 |     xpointer="xpointer(//*[@os='f'])"/>
 | 
|---|
 | 49 | 
 | 
|---|
 | 50 |     <para os="dd">For NPTL enabled systems we will need to add the following lines to
 | 
|---|
 | 51 |     <filename>config.cache</filename>:</para>
 | 
|---|
 | 52 | 
 | 
|---|
 | 53 | <screen os="de"><userinput>echo "libc_cv_forced_unwind=yes" > config.cache
 | 
|---|
 | 54 | echo "libc_cv_c_cleanup=yes" >> config.cache</userinput></screen>
 | 
|---|
 | 55 | 
 | 
|---|
 | 56 |     <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
 | 
|---|
 | 57 |     href="../../final-system/common/glibc.xml"
 | 
|---|
 | 58 |     xpointer="xpointer(//*[@os='g'])"/>
 | 
|---|
 | 59 | 
 | 
|---|
| [d3a4fc0] | 60 | <screen os="df"><userinput>BUILD_CC="gcc" CC="${LFS_TARGET}-gcc" \
 | 
|---|
| [3f8be484] | 61 |     AR="${LFS_TARGET}-ar" RANLIB="${LFS_TARGET}-ranlib" \
 | 
|---|
 | 62 |     ../glibc-&glibc-version;/configure --prefix=/tools \
 | 
|---|
 | 63 |     --host=${LFS_TARGET} --build=${LFS_HOST} \
 | 
|---|
 | 64 |     --disable-profile --enable-add-ons \
 | 
|---|
 | 65 |     --with-tls --enable-kernel=2.6.0 --with-__thread \
 | 
|---|
 | 66 |     --with-binutils=/cross-tools/bin --with-headers=/tools/include \
 | 
|---|
 | 67 |     --cache-file=config.cache</userinput></screen>
 | 
|---|
 | 68 | 
 | 
|---|
| [d3a4fc0] | 69 |     <variablelist os="dg">
 | 
|---|
| [3f8be484] | 70 |       <title>The meaning of the new configure options:</title>
 | 
|---|
 | 71 | 
 | 
|---|
| [d3a4fc0] | 72 |       <varlistentry os="dg1">
 | 
|---|
| [3f8be484] | 73 |         <term><parameter>BUILD_CC="gcc"</parameter></term>
 | 
|---|
 | 74 |         <listitem>
 | 
|---|
| [d3a4fc0] | 75 |           <para>This sets GLIBC to use the current compiler on our system. This is
 | 
|---|
 | 76 |           used to create the tools GLIBC uses durings it's build.</para>
 | 
|---|
| [3f8be484] | 77 |         </listitem>
 | 
|---|
 | 78 |       </varlistentry>
 | 
|---|
 | 79 | 
 | 
|---|
| [d3a4fc0] | 80 |       <varlistentry os="dg2">
 | 
|---|
| [3f8be484] | 81 |         <term><parameter>CC="${LFS_TARGET}-gcc"</parameter></term>
 | 
|---|
 | 82 |         <listitem>
 | 
|---|
| [d3a4fc0] | 83 |           <para>This forces GLIBC to use the GCC complier that we made for our target
 | 
|---|
 | 84 |           architecture.</para>
 | 
|---|
| [3f8be484] | 85 |         </listitem>
 | 
|---|
 | 86 |       </varlistentry>
 | 
|---|
 | 87 | 
 | 
|---|
| [d3a4fc0] | 88 |       <varlistentry os="dg3">
 | 
|---|
| [3f8be484] | 89 |         <term><parameter>AR="${LFS_TARGET}-ar"</parameter></term>
 | 
|---|
 | 90 |         <listitem>
 | 
|---|
| [6bb43b3] | 91 |           <para>This forces GLIBC to use the AR utility we made for our target
 | 
|---|
| [d3a4fc0] | 92 |           architecture.</para>
 | 
|---|
| [3f8be484] | 93 |         </listitem>
 | 
|---|
 | 94 |       </varlistentry>
 | 
|---|
 | 95 | 
 | 
|---|
| [d3a4fc0] | 96 |       <varlistentry os="dg4">
 | 
|---|
| [3f8be484] | 97 |         <term><parameter>RANLIB="${LFS_TARGET}-ranlib"</parameter></term>
 | 
|---|
 | 98 |         <listitem>
 | 
|---|
| [d3a4fc0] | 99 |           <para>This forces GLIBC to use the RANLIB utility we made for our target
 | 
|---|
 | 100 |           architecture.</para>
 | 
|---|
| [3f8be484] | 101 |         </listitem>
 | 
|---|
 | 102 |       </varlistentry>
 | 
|---|
 | 103 | 
 | 
|---|
| [d3a4fc0] | 104 |       <varlistentry os="dg5">
 | 
|---|
| [3f8be484] | 105 |         <term><parameter>--disable-profile</parameter></term>
 | 
|---|
 | 106 |         <listitem>
 | 
|---|
| [d3a4fc0] | 107 |           <para>This builds the libraries without profiling information. 
 | 
|---|
 | 108 |           Omit this option if profiling on the temporary tools is necessary.</para>
 | 
|---|
| [3f8be484] | 109 |         </listitem>
 | 
|---|
 | 110 |       </varlistentry>
 | 
|---|
 | 111 | 
 | 
|---|
| [d3a4fc0] | 112 |       <varlistentry os="dg6">
 | 
|---|
| [3f8be484] | 113 |         <term><parameter>--enable-add-ons</parameter></term>
 | 
|---|
 | 114 |         <listitem>
 | 
|---|
| [d3a4fc0] | 115 |           <para>This tells GLIBC to utilize all add-on's that are avaialble.</para>
 | 
|---|
| [3f8be484] | 116 |         </listitem>
 | 
|---|
 | 117 |       </varlistentry>
 | 
|---|
 | 118 | 
 | 
|---|
| [d3a4fc0] | 119 |       <varlistentry os="dg7">
 | 
|---|
| [3f8be484] | 120 |         <term><parameter>--with-tls</parameter></term>
 | 
|---|
 | 121 |         <listitem>
 | 
|---|
| [d3a4fc0] | 122 |           <para>This tells GLIBC to use Thread Local Storage.</para>
 | 
|---|
| [3f8be484] | 123 |         </listitem>
 | 
|---|
 | 124 |       </varlistentry>
 | 
|---|
 | 125 | 
 | 
|---|
| [d3a4fc0] | 126 |       <varlistentry os="dg8">
 | 
|---|
| [3f8be484] | 127 |         <term><parameter>--with-__thread</parameter></term>
 | 
|---|
 | 128 |         <listitem>
 | 
|---|
| [d3a4fc0] | 129 |           <para>This tells GLIBC to use use the __thread for libc and
 | 
|---|
 | 130 |           libpthread builds.</para>
 | 
|---|
| [3f8be484] | 131 |         </listitem>
 | 
|---|
 | 132 |       </varlistentry>
 | 
|---|
 | 133 | 
 | 
|---|
| [d3a4fc0] | 134 |       <varlistentry os="dg9">
 | 
|---|
| [3f8be484] | 135 |         <term><parameter>--with-binutils=/cross-tools/bin</parameter></term>
 | 
|---|
 | 136 |         <listitem>
 | 
|---|
| [d3a4fc0] | 137 |           <para>This tells GLIBC to use the Binutils that are specific to
 | 
|---|
 | 138 |           our target architecture.</para>
 | 
|---|
| [3f8be484] | 139 |         </listitem>
 | 
|---|
 | 140 |       </varlistentry>
 | 
|---|
 | 141 | 
 | 
|---|
| [d3a4fc0] | 142 |       <varlistentry os="dg10">
 | 
|---|
| [3f8be484] | 143 |         <term><parameter>--cache-file=config.cache</parameter></term>
 | 
|---|
 | 144 |         <listitem>
 | 
|---|
| [d3a4fc0] | 145 |           <para>This tells GLIBC to utilize a premade cache file.</para>
 | 
|---|
| [3f8be484] | 146 |         </listitem>
 | 
|---|
 | 147 |       </varlistentry>
 | 
|---|
 | 148 | 
 | 
|---|
 | 149 |     </variablelist>
 | 
|---|
 | 150 | 
 | 
|---|
| [d3a4fc0] | 151 |     <para os="dh">During this stage the following warning might appear:</para>
 | 
|---|
| [3f8be484] | 152 | 
 | 
|---|
| [d3a4fc0] | 153 | <blockquote os="di"><screen><computeroutput>configure: WARNING:
 | 
|---|
| [3f8be484] | 154 | *** These auxiliary programs are missing or
 | 
|---|
 | 155 | *** incompatible versions: msgfmt
 | 
|---|
 | 156 | *** some features will be disabled.
 | 
|---|
 | 157 | *** Check the INSTALL file for required versions.</computeroutput></screen></blockquote>
 | 
|---|
 | 158 | 
 | 
|---|
| [d3a4fc0] | 159 |     <para os="dj">The missing or incompatible <command>msgfmt</command> program is
 | 
|---|
| [3f8be484] | 160 |     generally harmless. This <command>msgfmt</command> program is part of the
 | 
|---|
 | 161 |     Gettext package which the host distribution should provide.</para>
 | 
|---|
 | 162 | 
 | 
|---|
| [d3a4fc0] | 163 |     <para os="dk">Compile the package:</para>
 | 
|---|
| [3f8be484] | 164 | 
 | 
|---|
| [d3a4fc0] | 165 | <screen os="dl"><userinput>make</userinput></screen>
 | 
|---|
| [3f8be484] | 166 | 
 | 
|---|
| [d3a4fc0] | 167 |     <para os="dm">Install the package:</para>
 | 
|---|
| [3f8be484] | 168 | 
 | 
|---|
| [d3a4fc0] | 169 | <screen os="dn"><userinput>make install</userinput></screen>
 | 
|---|
| [3f8be484] | 170 | 
 | 
|---|
 | 171 |   </sect2>
 | 
|---|
 | 172 | 
 | 
|---|
 | 173 |   <sect2 role="content">
 | 
|---|
 | 174 |     <title/>
 | 
|---|
 | 175 | 
 | 
|---|
 | 176 |     <para>Details on this package are located in <xref
 | 
|---|
 | 177 |     linkend="contents-glibc" role="."/></para>
 | 
|---|
 | 178 | 
 | 
|---|
 | 179 |   </sect2>
 | 
|---|
 | 180 | 
 | 
|---|
 | 181 | </sect1>
 | 
|---|