[3f8be484] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[aa18ac0] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[3f8be484] | 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 |
|
---|
[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 Headers</title>
|
---|
| 24 |
|
---|
[9f5a80a] | 25 | <para os="s1">Glibc's <filename>configure</filename> script checks the
|
---|
| 26 | version of GCC, and will fail if it's less than 3.4. The next Glibc build
|
---|
| 27 | will use the GCC that will be installed into
|
---|
| 28 | <filename class="directory">/cross-tools</filename> in the next step.
|
---|
| 29 | However, in this step only the Glibc headers are being installed - no
|
---|
| 30 | compiling is taking place - so the GCC version isn't important. The
|
---|
| 31 | following sed removes the dependency of GCC 3.4.x:</para>
|
---|
[d018b81] | 32 |
|
---|
[661d1a4] | 33 | <screen os="s2"><userinput>cp -v configure{,.orig}
|
---|
[1b274255] | 34 | sed -e 's/3.4/3.[0-9]/g' configure.orig > configure</userinput></screen>
|
---|
[3f8be484] | 35 |
|
---|
| 36 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
| 37 | href="../../final-system/common/glibc.xml"
|
---|
| 38 | xpointer="xpointer(//*[@os='e'])"/>
|
---|
| 39 |
|
---|
| 40 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
| 41 | href="../../final-system/common/glibc.xml"
|
---|
| 42 | xpointer="xpointer(//*[@os='f'])"/>
|
---|
| 43 |
|
---|
[c4d5e29] | 44 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
| 45 | href="../common/glibc.xml"
|
---|
| 46 | xpointer="xpointer(//*[@os='dd'])"/>
|
---|
| 47 |
|
---|
[c768003] | 48 | <screen os="de"><userinput>cat > config.cache << "EOF"
|
---|
| 49 | libc_cv_forced_unwind=yes
|
---|
| 50 | libc_cv_c_cleanup=yes
|
---|
| 51 | libc_cv_mlong_double_128=yes
|
---|
| 52 | libc_cv_alpha_tls=yes
|
---|
| 53 | libc_cv_gnu99_inline=yes
|
---|
| 54 | EOF</userinput></screen>
|
---|
[f0ed7ed] | 55 |
|
---|
[3f8be484] | 56 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
| 57 | href="../../final-system/common/glibc.xml"
|
---|
| 58 | xpointer="xpointer(//*[@os='g'])"/>
|
---|
| 59 |
|
---|
[7482ad3] | 60 | <screen os="s3"><userinput>CC=gcc ../glibc-&glibc-version;/configure --prefix=/tools \
|
---|
[07114c98] | 61 | --host=${CLFS_TARGET} --build=${CLFS_HOST} \
|
---|
[7482ad3] | 62 | --disable-sanity-checks --enable-kernel=2.6.0 \
|
---|
[bc2e3fa] | 63 | --with-headers=/tools/include --cache-file=config.cache \
|
---|
| 64 | --with-binutils=/cross-tools/${CLFS_TARGET}/bin</userinput></screen>
|
---|
[7482ad3] | 65 |
|
---|
[040521bc] | 66 | <note os="e1">
|
---|
[7482ad3] | 67 | <para><emphasis>Any</emphasis> error message you see about nptl at this point
|
---|
| 68 | can safely be ignored.</para>
|
---|
[040521bc] | 69 | </note>
|
---|
[7482ad3] | 70 |
|
---|
| 71 | <variablelist os="ca">
|
---|
| 72 | <title>The meaning of the configure options:</title>
|
---|
[d018b81] | 73 |
|
---|
[7482ad3] | 74 | <varlistentry os="ca1">
|
---|
| 75 | <term><parameter>CC=gcc</parameter></term>
|
---|
| 76 | <listitem>
|
---|
[3c06a53] | 77 | <para>Tells Glibc to use the host's GCC compiler.</para>
|
---|
[7482ad3] | 78 | </listitem>
|
---|
| 79 | </varlistentry>
|
---|
[d018b81] | 80 |
|
---|
[7482ad3] | 81 | <varlistentry os="ca2">
|
---|
| 82 | <term><parameter>--prefix=/tools</parameter></term>
|
---|
| 83 | <listitem>
|
---|
| 84 | <para>This tells the configure script to prepare to install the
|
---|
[e3196bd] | 85 | package in the <filename class="directory">/tools</filename>
|
---|
| 86 | directory.</para>
|
---|
[7482ad3] | 87 | </listitem>
|
---|
| 88 | </varlistentry>
|
---|
[d018b81] | 89 |
|
---|
[7482ad3] | 90 | <varlistentry os="ca3">
|
---|
[07114c98] | 91 | <term><parameter>--build=${CLFS_HOST}</parameter></term>
|
---|
[7482ad3] | 92 | <listitem>
|
---|
| 93 | <para>When used with --host, this creates a cross-architecture
|
---|
[3c06a53] | 94 | executable that creates files for ${CLFS_TARGET} but runs on ${CLFS_HOST}.</para>
|
---|
[7482ad3] | 95 | </listitem>
|
---|
| 96 | </varlistentry>
|
---|
[d018b81] | 97 |
|
---|
[7482ad3] | 98 | <varlistentry os="ca4">
|
---|
[07114c98] | 99 | <term><parameter>--host=${CLFS_TARGET}</parameter></term>
|
---|
[7482ad3] | 100 | <listitem>
|
---|
| 101 | <para>When used with --build, this creates a cross-architecture
|
---|
[3c06a53] | 102 | executable that creates files for ${CLFS_TARGET} but runs on ${CLFS_HOST}.</para>
|
---|
[7482ad3] | 103 | </listitem>
|
---|
| 104 | </varlistentry>
|
---|
[d018b81] | 105 |
|
---|
[7482ad3] | 106 | <varlistentry os="ca5">
|
---|
| 107 | <term><parameter>--disable-sanity-checks</parameter></term>
|
---|
| 108 | <listitem>
|
---|
| 109 | <para>This switch disables any checks that are in place.</para>
|
---|
| 110 | </listitem>
|
---|
| 111 | </varlistentry>
|
---|
[d018b81] | 112 |
|
---|
[7482ad3] | 113 | <varlistentry os="ca6">
|
---|
| 114 | <term><parameter>--enable-kernel=2.6.0</parameter></term>
|
---|
| 115 | <listitem>
|
---|
| 116 | <para>This tells Glibc to compile the library with support
|
---|
| 117 | for 2.6.x Linux kernels.</para>
|
---|
| 118 | </listitem>
|
---|
| 119 | </varlistentry>
|
---|
[d018b81] | 120 |
|
---|
[7482ad3] | 121 | <varlistentry os="ca7">
|
---|
[bc2e3fa] | 122 | <term><parameter>--with-headers=/tools/include</parameter></term>
|
---|
[7482ad3] | 123 | <listitem>
|
---|
| 124 | <para>This tells Glibc to compile itself against the headers
|
---|
[bc2e3fa] | 125 | recently installed to the <filename class="directory">/tools</filename>
|
---|
[7482ad3] | 126 | directory, so that it knows exactly what features the kernel has
|
---|
| 127 | and can optimize itself accordingly.</para>
|
---|
| 128 | </listitem>
|
---|
| 129 | </varlistentry>
|
---|
[d018b81] | 130 |
|
---|
[7482ad3] | 131 | <varlistentry os="ca8">
|
---|
[bc2e3fa] | 132 | <term><parameter>--with-binutils=/cross-tools/${CLFS_TARGET}/bin</parameter></term>
|
---|
[7482ad3] | 133 | <listitem>
|
---|
[3c06a53] | 134 | <para>This tells Glibc to use the Binutils for our specific target architecture.</para>
|
---|
[7482ad3] | 135 | </listitem>
|
---|
| 136 | </varlistentry>
|
---|
[d018b81] | 137 |
|
---|
[7482ad3] | 138 | </variablelist>
|
---|
[d018b81] | 139 |
|
---|
[7482ad3] | 140 | <para os="cb">Now, install the headers:</para>
|
---|
| 141 |
|
---|
| 142 | <screen os="cd"><userinput>make install-headers</userinput></screen>
|
---|
| 143 |
|
---|
[42754a9] | 144 | <para os="ce">Some files aren't installed by the above command, so
|
---|
| 145 | we will copy the additional header files we need.</para>
|
---|
[7482ad3] | 146 |
|
---|
[d018b81] | 147 | <para os="cf">First we will copy a common file over to <filename
|
---|
[bc2e3fa] | 148 | class="directory">/tools/include</filename>:</para>
|
---|
[7482ad3] | 149 |
|
---|
[bc2e3fa] | 150 | <screen os="cg"><userinput>install -dv /tools/include/bits
|
---|
| 151 | cp -v bits/stdio_lim.h /tools/include/bits</userinput></screen>
|
---|
[7482ad3] | 152 |
|
---|
| 153 | <para os="ch">Now we will create a blank stub file:</para>
|
---|
| 154 |
|
---|
[bc2e3fa] | 155 | <screen os="ci"><userinput>touch /tools/include/gnu/stubs.h</userinput></screen>
|
---|
[7482ad3] | 156 |
|
---|
[42754a9] | 157 | <para os="cj">Another header is needed for NPTL:</para>
|
---|
[d018b81] | 158 |
|
---|
| 159 | <screen><userinput>cp -v ../glibc-&glibc-version;/nptl/sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h \
|
---|
| 160 | /tools/include/bits/</userinput></screen>
|
---|
[3f8be484] | 161 |
|
---|
| 162 | </sect2>
|
---|
| 163 |
|
---|
| 164 | <sect2 role="content">
|
---|
| 165 | <title/>
|
---|
| 166 |
|
---|
| 167 | <para>Details on this package are located in <xref
|
---|
| 168 | linkend="contents-glibc" role="."/></para>
|
---|
| 169 |
|
---|
| 170 | </sect2>
|
---|
| 171 |
|
---|
| 172 | </sect1>
|
---|