| 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-headers" role="wrap">
 | 
|---|
| 9 |   <?dbhtml filename="glibc-headers.html"?>
 | 
|---|
| 10 | 
 | 
|---|
| 11 |   <title>Glibc-&glibc-version; Headers</title>
 | 
|---|
| 12 | 
 | 
|---|
| 13 |   <indexterm zone="ch-cross-tools-glibc-headers">
 | 
|---|
| 14 |     <primary sortas="a-Glibc">Glibc</primary>
 | 
|---|
| 15 |     <secondary>cross tools, headers</secondary>
 | 
|---|
| 16 |   </indexterm>
 | 
|---|
| 17 | 
 | 
|---|
| 18 |   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
 | 
|---|
| 19 |   href="../../final-system/common/glibc.xml"
 | 
|---|
| 20 |   xpointer="xpointer(//*[@role='package'])"/>
 | 
|---|
| 21 | 
 | 
|---|
| 22 |   <sect2 role="installation">
 | 
|---|
| 23 |     <title>Installation of Glibc Headers</title>
 | 
|---|
| 24 | 
 | 
|---|
| 25 |     <para os="s1">The following sed removes a dependency of gcc 3.4.x from
 | 
|---|
| 26 |     the glibc we are using in cross-lfs. The reason we are changing it is
 | 
|---|
| 27 |     because this only installs the headers, no compiling takes place. In the
 | 
|---|
| 28 |     next glibc chapter, we use the gcc that's build right after this chapter.</para>
 | 
|---|
| 29 | 
 | 
|---|
| 30 | <screen os="s2"><userinput>cp configure{,.orig}
 | 
|---|
| 31 | sed -e 's/3.4/3.[0-9]/g' configure.orig > configure</userinput></screen>
 | 
|---|
| 32 | 
 | 
|---|
| 33 |     <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
 | 
|---|
| 34 |     href="../../final-system/common/glibc.xml"
 | 
|---|
| 35 |     xpointer="xpointer(//*[@os='e'])"/>
 | 
|---|
| 36 | 
 | 
|---|
| 37 |     <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
 | 
|---|
| 38 |     href="../../final-system/common/glibc.xml"
 | 
|---|
| 39 |     xpointer="xpointer(//*[@os='f'])"/>
 | 
|---|
| 40 | 
 | 
|---|
| 41 |     <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
 | 
|---|
| 42 |     href="../common/glibc.xml"
 | 
|---|
| 43 |     xpointer="xpointer(//*[@os='dd'])"/>
 | 
|---|
| 44 | 
 | 
|---|
| 45 |     <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
 | 
|---|
| 46 |     href="../common/glibc.xml"
 | 
|---|
| 47 |     xpointer="xpointer(//*[@os='de'])"/>
 | 
|---|
| 48 | 
 | 
|---|
| 49 |     <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
 | 
|---|
| 50 |     href="../../final-system/common/glibc.xml"
 | 
|---|
| 51 |     xpointer="xpointer(//*[@os='g'])"/>
 | 
|---|
| 52 | 
 | 
|---|
| 53 | <screen os="s3"><userinput>CC=gcc ../glibc-&glibc-version;/configure --prefix=/tools \
 | 
|---|
| 54 |     --host=${LFS_TARGET} --build=${LFS_HOST} \
 | 
|---|
| 55 |     --disable-sanity-checks --enable-kernel=2.6.0 \
 | 
|---|
| 56 |     --with-headers=/tools/include --cache-file=config.cache \
 | 
|---|
| 57 |     --with-binutils=/cross-tools/${LFS_TARGET}/bin</userinput></screen>
 | 
|---|
| 58 | 
 | 
|---|
| 59 |    <warning os="e1">
 | 
|---|
| 60 |       <para><emphasis>Any</emphasis> error message you see about nptl at this point
 | 
|---|
| 61 |        can safely be ignored.</para>
 | 
|---|
| 62 |    </warning>
 | 
|---|
| 63 | 
 | 
|---|
| 64 |     <variablelist os="ca">
 | 
|---|
| 65 |       <title>The meaning of the configure options:</title>
 | 
|---|
| 66 | 
 | 
|---|
| 67 |       <varlistentry os="ca1">
 | 
|---|
| 68 |         <term><parameter>CC=gcc</parameter></term>
 | 
|---|
| 69 |         <listitem>
 | 
|---|
| 70 |           <para>Tells GLIBC to use the hosts GCC compiler.</para>
 | 
|---|
| 71 |         </listitem>
 | 
|---|
| 72 |       </varlistentry>
 | 
|---|
| 73 | 
 | 
|---|
| 74 |       <varlistentry os="ca2">
 | 
|---|
| 75 |         <term><parameter>--prefix=/tools</parameter></term>
 | 
|---|
| 76 |         <listitem>
 | 
|---|
| 77 |           <para>This tells the configure script to prepare to install the
 | 
|---|
| 78 |           package in the <filename class="directory">/tools</filename>
 | 
|---|
| 79 |           directory.</para>
 | 
|---|
| 80 |         </listitem>
 | 
|---|
| 81 |       </varlistentry>
 | 
|---|
| 82 | 
 | 
|---|
| 83 |       <varlistentry os="ca3">
 | 
|---|
| 84 |         <term><parameter>--build=${LFS_HOST}</parameter></term>
 | 
|---|
| 85 |         <listitem>
 | 
|---|
| 86 |           <para>When used with --host, this creates a cross-architecture
 | 
|---|
| 87 |           executable that creates files for ${LFS_TARGET} but runs on ${LFS_HOST).</para>
 | 
|---|
| 88 |         </listitem>
 | 
|---|
| 89 |       </varlistentry>
 | 
|---|
| 90 | 
 | 
|---|
| 91 |       <varlistentry os="ca4">
 | 
|---|
| 92 |         <term><parameter>--host=${LFS_TARGET}</parameter></term>
 | 
|---|
| 93 |         <listitem>
 | 
|---|
| 94 |           <para>When used with --build, this creates a cross-architecture
 | 
|---|
| 95 |           executable that creates files for ${LFS_TARGET} but runs on ${LFS_HOST).</para>
 | 
|---|
| 96 |         </listitem>
 | 
|---|
| 97 |       </varlistentry>
 | 
|---|
| 98 | 
 | 
|---|
| 99 |       <varlistentry os="ca5">
 | 
|---|
| 100 |         <term><parameter>--disable-sanity-checks</parameter></term>
 | 
|---|
| 101 |         <listitem>
 | 
|---|
| 102 |           <para>This switch disables any checks that are in place.</para>
 | 
|---|
| 103 |         </listitem>
 | 
|---|
| 104 |       </varlistentry>
 | 
|---|
| 105 | 
 | 
|---|
| 106 |       <varlistentry os="ca6">
 | 
|---|
| 107 |         <term><parameter>--enable-kernel=2.6.0</parameter></term>
 | 
|---|
| 108 |         <listitem>
 | 
|---|
| 109 |           <para>This tells Glibc to compile the library with support
 | 
|---|
| 110 |           for 2.6.x Linux kernels.</para>
 | 
|---|
| 111 |         </listitem>
 | 
|---|
| 112 |       </varlistentry>
 | 
|---|
| 113 | 
 | 
|---|
| 114 |       <varlistentry os="ca7">
 | 
|---|
| 115 |         <term><parameter>--with-headers=/tools/include</parameter></term>
 | 
|---|
| 116 |         <listitem>
 | 
|---|
| 117 |           <para>This tells Glibc to compile itself against the headers
 | 
|---|
| 118 |           recently installed to the <filename class="directory">/tools</filename>
 | 
|---|
| 119 |           directory, so that it knows exactly what features the kernel has
 | 
|---|
| 120 |           and can optimize itself accordingly.</para>
 | 
|---|
| 121 |         </listitem>
 | 
|---|
| 122 |       </varlistentry>
 | 
|---|
| 123 | 
 | 
|---|
| 124 |       <varlistentry os="ca8">
 | 
|---|
| 125 |         <term><parameter>--with-binutils=/cross-tools/${LFS_TARGET}/bin</parameter></term>
 | 
|---|
| 126 |         <listitem>
 | 
|---|
| 127 |           <para>This tells GLIBC to use the binutils for our specific target architecture.</para>
 | 
|---|
| 128 |         </listitem>
 | 
|---|
| 129 |       </varlistentry>
 | 
|---|
| 130 | 
 | 
|---|
| 131 |     </variablelist>
 | 
|---|
| 132 | 
 | 
|---|
| 133 |     <para os="cb">Now, install the headers:</para>
 | 
|---|
| 134 | 
 | 
|---|
| 135 | <screen os="cd"><userinput>make install-headers</userinput></screen>
 | 
|---|
| 136 | 
 | 
|---|
| 137 |     <para os="ce">Some files aren't installed by the above command, then
 | 
|---|
| 138 |     we will copy the header files we need:</para>
 | 
|---|
| 139 | 
 | 
|---|
| 140 |     <para os="cf">First we will copy a common file over to <filename
 | 
|---|
| 141 |     class="directory">/tools/include</filename>:</para>
 | 
|---|
| 142 | 
 | 
|---|
| 143 | <screen os="cg"><userinput>install -d /tools/include/bits
 | 
|---|
| 144 | cp bits/stdio_lim.h /tools/include/bits</userinput></screen>
 | 
|---|
| 145 | 
 | 
|---|
| 146 |     <para os="ch">Now we will create a blank stub file:</para>
 | 
|---|
| 147 | 
 | 
|---|
| 148 | <screen os="ci"><userinput>touch /tools/include/gnu/stubs.h</userinput></screen>
 | 
|---|
| 149 | 
 | 
|---|
| 150 |     <para os="cj">For NPTL we use the following command:</para>
 | 
|---|
| 151 | 
 | 
|---|
| 152 | <screen os="ck"><userinput>cp ../glibc-&glibc-version;/nptl/sysdeps/pthread/pthread.h /tools/include/</userinput></screen>
 | 
|---|
| 153 | 
 | 
|---|
| 154 |     <para os="cl">Now we copy the architecture specific header over:</para>
 | 
|---|
| 155 | 
 | 
|---|
| 156 | <screen os="cm"><userinput>cp ../glibc-&glibc-version;/nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h /tools/include/bits/</userinput></screen>
 | 
|---|
| 157 | 
 | 
|---|
| 158 |   </sect2>
 | 
|---|
| 159 | 
 | 
|---|
| 160 |   <sect2 role="content">
 | 
|---|
| 161 |     <title/>
 | 
|---|
| 162 | 
 | 
|---|
| 163 |     <para>Details on this package are located in <xref
 | 
|---|
| 164 |     linkend="contents-glibc" role="."/></para>
 | 
|---|
| 165 | 
 | 
|---|
| 166 |   </sect2>
 | 
|---|
| 167 | 
 | 
|---|
| 168 | </sect1>
 | 
|---|