[bf8c11f] | 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 |
|
---|
[48f8316] | 18 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
| 19 | href="../../final-system/common/glibc.xml"
|
---|
| 20 | xpointer="xpointer(//*[@role='package'])"/>
|
---|
[bf8c11f] | 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
|
---|
[ed3e5d8] | 28 | next glibc chapter, we use the gcc that's built right after this chapter.</para>
|
---|
[bf8c11f] | 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 |
|
---|
[157894b] | 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 |
|
---|
[bf8c11f] | 49 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
| 50 | href="../../final-system/common/glibc.xml"
|
---|
| 51 | xpointer="xpointer(//*[@os='g'])"/>
|
---|
| 52 |
|
---|
[c48c555] | 53 | <screen os="s3"><userinput>CC=gcc ../glibc-&glibc-version;/configure --prefix=/tools \
|
---|
[bf8c11f] | 54 | --host=${LFS_TARGET} --build=${LFS_HOST} \
|
---|
| 55 | --disable-sanity-checks --enable-kernel=2.6.0 \
|
---|
[157894b] | 56 | --with-headers=/tools/include --cache-file=config.cache \
|
---|
[bf8c11f] | 57 | --with-binutils=/cross-tools/${LFS_TARGET}/bin</userinput></screen>
|
---|
| 58 |
|
---|
| 59 | <warning os="e1">
|
---|
[c48c555] | 60 | <para><emphasis>Any</emphasis> error message you see about nptl at this point
|
---|
[bf8c11f] | 61 | can safely be ignored.</para>
|
---|
| 62 | </warning>
|
---|
| 63 |
|
---|
| 64 | <variablelist os="ca">
|
---|
| 65 | <title>The meaning of the configure options:</title>
|
---|
| 66 |
|
---|
[c48c555] | 67 | <varlistentry os="ca1">
|
---|
[bf8c11f] | 68 | <term><parameter>CC=gcc</parameter></term>
|
---|
| 69 | <listitem>
|
---|
[c48c555] | 70 | <para>Tells GLIBC to use the hosts GCC compiler.</para>
|
---|
[bf8c11f] | 71 | </listitem>
|
---|
| 72 | </varlistentry>
|
---|
| 73 |
|
---|
[c48c555] | 74 | <varlistentry os="ca2">
|
---|
[90fe4aa] | 75 | <term><parameter>--build=${LFS_HOST}</parameter></term>
|
---|
[bf8c11f] | 76 | <listitem>
|
---|
[6a8671a] | 77 | <para>When used with --host, this creates a cross-architecture
|
---|
[c48c555] | 78 | executable that creates files for ${LFS_TARGET} but runs on ${LFS_HOST).</para>
|
---|
[bf8c11f] | 79 | </listitem>
|
---|
| 80 | </varlistentry>
|
---|
| 81 |
|
---|
[ed3e5d8] | 82 | <varlistentry os="ca3">
|
---|
[6a8671a] | 83 | <term><parameter>--host=${LFS_TARGET}</parameter></term>
|
---|
[bf8c11f] | 84 | <listitem>
|
---|
[6a8671a] | 85 | <para>When used with --build, this creates a cross-architecture
|
---|
[c48c555] | 86 | executable that creates files for ${LFS_TARGET} but runs on ${LFS_HOST).</para>
|
---|
[bf8c11f] | 87 | </listitem>
|
---|
| 88 | </varlistentry>
|
---|
| 89 |
|
---|
[ed3e5d8] | 90 | <varlistentry os="ca4">
|
---|
[bf8c11f] | 91 | <term><parameter>--disable-sanity-checks</parameter></term>
|
---|
| 92 | <listitem>
|
---|
[c48c555] | 93 | <para>This switch disables any checks that are in place.</para>
|
---|
[bf8c11f] | 94 | </listitem>
|
---|
| 95 | </varlistentry>
|
---|
| 96 |
|
---|
[ed3e5d8] | 97 | <varlistentry os="ca5">
|
---|
[bf8c11f] | 98 | <term><parameter>--enable-kernel=2.6.0</parameter></term>
|
---|
| 99 | <listitem>
|
---|
| 100 | <para>This tells Glibc to compile the library with support
|
---|
| 101 | for 2.6.x Linux kernels.</para>
|
---|
| 102 | </listitem>
|
---|
| 103 | </varlistentry>
|
---|
| 104 |
|
---|
[ed3e5d8] | 105 | <varlistentry os="ca6">
|
---|
[bf8c11f] | 106 | <term><parameter>--with-headers=/tools/include</parameter></term>
|
---|
| 107 | <listitem>
|
---|
| 108 | <para>This tells Glibc to compile itself against the headers
|
---|
| 109 | recently installed to the <filename class="directory">/tools</filename>
|
---|
| 110 | directory, so that it knows exactly what features the kernel has
|
---|
| 111 | and can optimize itself accordingly.</para>
|
---|
| 112 | </listitem>
|
---|
| 113 | </varlistentry>
|
---|
| 114 |
|
---|
[ed3e5d8] | 115 | <varlistentry os="ca7">
|
---|
[bf8c11f] | 116 | <term><parameter>--with-binutils=/cross-tools/${LFS_TARGET}/bin</parameter></term>
|
---|
| 117 | <listitem>
|
---|
[c48c555] | 118 | <para>This tells GLIBC to use the binutils for our specific target architecture.</para>
|
---|
[bf8c11f] | 119 | </listitem>
|
---|
| 120 | </varlistentry>
|
---|
| 121 |
|
---|
| 122 | </variablelist>
|
---|
| 123 |
|
---|
| 124 | <para os="cb">Now, install the headers:</para>
|
---|
| 125 |
|
---|
| 126 | <screen os="cd"><userinput>make install-headers</userinput></screen>
|
---|
| 127 |
|
---|
[ed3e5d8] | 128 | <para os="ce">Some files aren't installed by the above command, so we will copy the additional header files we need:</para>
|
---|
[bf8c11f] | 129 |
|
---|
| 130 | <para os="cf">First we will copy a common file over to <filename
|
---|
| 131 | class="directory">/tools/include</filename>:</para>
|
---|
| 132 |
|
---|
| 133 | <screen os="cg"><userinput>install -d /tools/include/bits
|
---|
| 134 | cp bits/stdio_lim.h /tools/include/bits</userinput></screen>
|
---|
| 135 |
|
---|
| 136 | <para os="ch">Now we will create a blank stub file:</para>
|
---|
| 137 |
|
---|
| 138 | <screen os="ci"><userinput>touch /tools/include/gnu/stubs.h</userinput></screen>
|
---|
| 139 |
|
---|
| 140 | <para os="cj">For NPTL we use the following command:</para>
|
---|
| 141 |
|
---|
| 142 | <screen os="ck"><userinput>cp ../glibc-&glibc-version;/nptl/sysdeps/pthread/pthread.h /tools/include/</userinput></screen>
|
---|
| 143 |
|
---|
| 144 | <para os="cl">Now we copy the architecture specific header over:</para>
|
---|
| 145 |
|
---|
[c48c555] | 146 | <screen os="cm"><userinput>cp ../glibc-&glibc-version;/nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h /tools/include/bits/</userinput></screen>
|
---|
[bf8c11f] | 147 |
|
---|
| 148 | </sect2>
|
---|
| 149 |
|
---|
| 150 | <sect2 role="content">
|
---|
| 151 | <title/>
|
---|
| 152 |
|
---|
| 153 | <para>Details on this package are located in <xref
|
---|
| 154 | linkend="contents-glibc" role="."/></para>
|
---|
| 155 |
|
---|
| 156 | </sect2>
|
---|
| 157 |
|
---|
| 158 | </sect1>
|
---|