source: BOOK/cross-tools/alpha/glibc-headers.xml@ 1a5985d

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 1a5985d was 9f5a80a, checked in by Chris Staub <chris@…>, 16 years ago

Text updates

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