source: BOOK/cross-tools/x86/glibc-headers.xml@ 9617ced

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 9617ced was df709be, checked in by Jim Gifford <clfs@…>, 19 years ago

r2424@server (orig r1210): chris | 2006-02-26 10:57:18 -0800
Minor text updates

  • Property mode set to 100644
File size: 5.9 KB
RevLine 
[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-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
25 <para os="s1">The following sed removes a dependency of gcc 3.4.x from
[6d4c909]26 the glibc used in cross-lfs. The reason it is changed is
27 because only the headers are being installed now; no compiling takes place.
28 In the next glibc build, the gcc that's built right after this section will be used.</para>
[3f8be484]29
[f729ad2]30<screen os="s2"><userinput>cp -v configure{,.orig}
[3f8be484]31sed -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
[c4d5e29]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
[f0ed7ed]49 <para os="df">Glibc has an issue cross-compiling the headers, where it can
50 misdetect the capabilities of Binutils and decide they are inadequate. The
51 following line fixes this:</para>
52
53<screen os="dg"><userinput>echo "libc_cv_initfini_array=yes" &gt;&gt; config.cache
54</userinput></screen>
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
[d3a4fc0]60<screen os="s3"><userinput>CC=gcc ../glibc-&glibc-version;/configure --prefix=/tools \
[3f8be484]61 --host=${LFS_TARGET} --build=${LFS_HOST} \
62 --disable-sanity-checks --enable-kernel=2.6.0 \
[c4d5e29]63 --with-headers=/tools/include --cache-file=config.cache \
[3f8be484]64 --with-binutils=/cross-tools/${LFS_TARGET}/bin</userinput></screen>
65
[1322a63]66 <note os="e1">
67 <para><emphasis>Any</emphasis> error message you see about nptl at this
68 point can safely be ignored.</para>
69 </note>
[3f8be484]70
71 <variablelist os="ca">
72 <title>The meaning of the configure options:</title>
73
[d3a4fc0]74 <varlistentry os="ca1">
[3f8be484]75 <term><parameter>CC=gcc</parameter></term>
76 <listitem>
[6d4c909]77 <para>Tells Glibc to use the host's GCC compiler.</para>
[3f8be484]78 </listitem>
79 </varlistentry>
80
[d3a4fc0]81 <varlistentry os="ca2">
[53de1f5]82 <term><parameter>--build=${LFS_HOST}</parameter></term>
[3f8be484]83 <listitem>
[253c621]84 <para>When used with --host, this creates a cross-architecture
[d3a4fc0]85 executable that creates files for ${LFS_TARGET} but runs on ${LFS_HOST).</para>
[3f8be484]86 </listitem>
87 </varlistentry>
88
[8659630]89 <varlistentry os="ca3">
[253c621]90 <term><parameter>--host=${LFS_TARGET}</parameter></term>
[3f8be484]91 <listitem>
[253c621]92 <para>When used with --build, this creates a cross-architecture
[d3a4fc0]93 executable that creates files for ${LFS_TARGET} but runs on ${LFS_HOST).</para>
[3f8be484]94 </listitem>
95 </varlistentry>
96
[8659630]97 <varlistentry os="ca4">
[3f8be484]98 <term><parameter>--disable-sanity-checks</parameter></term>
99 <listitem>
[d3a4fc0]100 <para>This switch disables any checks that are in place.</para>
[3f8be484]101 </listitem>
102 </varlistentry>
103
[8659630]104 <varlistentry os="ca5">
[3f8be484]105 <term><parameter>--enable-kernel=2.6.0</parameter></term>
106 <listitem>
107 <para>This tells Glibc to compile the library with support
108 for 2.6.x Linux kernels.</para>
109 </listitem>
110 </varlistentry>
111
[8659630]112 <varlistentry os="ca6">
[3f8be484]113 <term><parameter>--with-headers=/tools/include</parameter></term>
114 <listitem>
115 <para>This tells Glibc to compile itself against the headers
116 recently installed to the <filename class="directory">/tools</filename>
117 directory, so that it knows exactly what features the kernel has
118 and can optimize itself accordingly.</para>
119 </listitem>
120 </varlistentry>
121
[8659630]122 <varlistentry os="ca7">
[3f8be484]123 <term><parameter>--with-binutils=/cross-tools/${LFS_TARGET}/bin</parameter></term>
124 <listitem>
[6d4c909]125 <para>This tells Glibc to use the binutils for the specific target architecture.</para>
[3f8be484]126 </listitem>
127 </varlistentry>
128
129 </variablelist>
130
131 <para os="cb">Now, install the headers:</para>
132
133<screen os="cd"><userinput>make install-headers</userinput></screen>
134
[6d4c909]135 <para os="ce">Some files aren't installed by the above command, so copy the additional header files that are needed:</para>
[3f8be484]136
[6d4c909]137 <para os="cf">First copy a common file over to <filename
[3f8be484]138 class="directory">/tools/include</filename>:</para>
139
[6bfb353]140<screen os="cg"><userinput>cp -v bits/stdio_lim.h /tools/include/bits</userinput></screen>
[3f8be484]141
[6d4c909]142 <para os="ch">Now create a blank stub file:</para>
[3f8be484]143
144<screen os="ci"><userinput>touch /tools/include/gnu/stubs.h</userinput></screen>
145
[6d4c909]146 <para os="cj">For NPTL use the following command:</para>
[3f8be484]147
[df709be]148<screen os="ck"><userinput>cp -v \
149../glibc-&glibc-version;/nptl/sysdeps/pthread/pthread.h \
150/tools/include</userinput></screen>
[3f8be484]151
[6d4c909]152 <para os="cl">Now copy the architecture specific header over:</para>
[3f8be484]153
[df709be]154<screen os="cm"><userinput>cp -v \
155../glibc-&glibc-version;/nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h \
156/tools/include/bits</userinput></screen>
[3f8be484]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>
Note: See TracBrowser for help on using the repository browser.