[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" role="wrap">
|
---|
| 9 | <?dbhtml filename="glibc.html"?>
|
---|
| 10 |
|
---|
| 11 | <title>Glibc-&glibc-version;</title>
|
---|
| 12 |
|
---|
| 13 | <indexterm zone="ch-cross-tools-glibc">
|
---|
| 14 | <primary sortas="a-Glibc">Glibc</primary>
|
---|
| 15 | <secondary>cross tools</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</title>
|
---|
| 24 |
|
---|
| 25 | <para os="da">It should be noted that compiling Glibc in any way other than
|
---|
| 26 | the method suggested in this book puts the stability of the system at
|
---|
| 27 | risk.</para>
|
---|
| 28 |
|
---|
[cbfa0a3] | 29 | <para os="db">Disable linking to <filename>libgcc_eh</filename>:</para>
|
---|
[bf8c11f] | 30 |
|
---|
| 31 | <screen os="dc"><userinput>patch -Np1 -i ../&glibc-libgcc_eh-patch;</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='c'])"/>
|
---|
| 36 |
|
---|
| 37 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
| 38 | href="../../final-system/common/glibc.xml"
|
---|
| 39 | xpointer="xpointer(//*[@os='d'])"/>
|
---|
| 40 |
|
---|
[de99e63] | 41 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
| 42 | href="../../final-system/common/glibc.xml"
|
---|
| 43 | xpointer="xpointer(//*[@os='s1'])"/>
|
---|
| 44 |
|
---|
| 45 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
| 46 | href="../../final-system/common/glibc.xml"
|
---|
| 47 | xpointer="xpointer(//*[@os='s2'])"/>
|
---|
| 48 |
|
---|
[fd90c25f] | 49 | <para os="s1">The following sed fixes a build issue with Glibc. This will
|
---|
| 50 | prevent nscd from trying to link to libraries that don't exist:</para>
|
---|
[0aff0e3] | 51 |
|
---|
| 52 | <screen os="s2"><userinput>cp nscd/Makefile{,.orig}
|
---|
| 53 | sed -e "/nscd_stat.o: sysincludes = # nothing/d" nscd/Makefile.orig > nscd/Makefile</userinput></screen>
|
---|
| 54 |
|
---|
[bf8c11f] | 55 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
| 56 | href="../../final-system/common/glibc.xml"
|
---|
| 57 | xpointer="xpointer(//*[@os='e'])"/>
|
---|
| 58 |
|
---|
| 59 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
| 60 | href="../../final-system/common/glibc.xml"
|
---|
| 61 | xpointer="xpointer(//*[@os='f'])"/>
|
---|
| 62 |
|
---|
[cbfa0a3] | 63 | <para os="dd">For NPTL enabled systems the following lines need
|
---|
| 64 | to be added to <filename>config.cache</filename>:</para>
|
---|
[bf8c11f] | 65 |
|
---|
| 66 | <screen os="de"><userinput>echo "libc_cv_forced_unwind=yes" > config.cache
|
---|
| 67 | echo "libc_cv_c_cleanup=yes" >> config.cache</userinput></screen>
|
---|
| 68 |
|
---|
| 69 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
| 70 | href="../../final-system/common/glibc.xml"
|
---|
| 71 | xpointer="xpointer(//*[@os='g'])"/>
|
---|
| 72 |
|
---|
[c48c555] | 73 | <screen os="df"><userinput>BUILD_CC="gcc" CC="${LFS_TARGET}-gcc" \
|
---|
[bf8c11f] | 74 | AR="${LFS_TARGET}-ar" RANLIB="${LFS_TARGET}-ranlib" \
|
---|
| 75 | ../glibc-&glibc-version;/configure --prefix=/tools \
|
---|
| 76 | --host=${LFS_TARGET} --build=${LFS_HOST} \
|
---|
| 77 | --disable-profile --enable-add-ons \
|
---|
| 78 | --with-tls --enable-kernel=2.6.0 --with-__thread \
|
---|
| 79 | --with-binutils=/cross-tools/bin --with-headers=/tools/include \
|
---|
| 80 | --cache-file=config.cache</userinput></screen>
|
---|
| 81 |
|
---|
[c48c555] | 82 | <variablelist os="dg">
|
---|
[bf8c11f] | 83 | <title>The meaning of the new configure options:</title>
|
---|
| 84 |
|
---|
[c48c555] | 85 | <varlistentry os="dg1">
|
---|
[bf8c11f] | 86 | <term><parameter>BUILD_CC="gcc"</parameter></term>
|
---|
| 87 | <listitem>
|
---|
[cbfa0a3] | 88 | <para>This sets Glibc to use the current compiler on our system. This is
|
---|
[506b086] | 89 | used to create the tools Glibc uses during its build.</para>
|
---|
[bf8c11f] | 90 | </listitem>
|
---|
| 91 | </varlistentry>
|
---|
| 92 |
|
---|
[c48c555] | 93 | <varlistentry os="dg2">
|
---|
[bf8c11f] | 94 | <term><parameter>CC="${LFS_TARGET}-gcc"</parameter></term>
|
---|
| 95 | <listitem>
|
---|
[b09f8ce] | 96 | <para>This forces Glibc to use the GCC compiler that we made for our target
|
---|
[c48c555] | 97 | architecture.</para>
|
---|
[bf8c11f] | 98 | </listitem>
|
---|
| 99 | </varlistentry>
|
---|
| 100 |
|
---|
[c48c555] | 101 | <varlistentry os="dg3">
|
---|
[bf8c11f] | 102 | <term><parameter>AR="${LFS_TARGET}-ar"</parameter></term>
|
---|
| 103 | <listitem>
|
---|
[b09f8ce] | 104 | <para>This forces Glibc to use the <command>ar</command> utility
|
---|
| 105 | we made for our target architecture.</para>
|
---|
[bf8c11f] | 106 | </listitem>
|
---|
| 107 | </varlistentry>
|
---|
| 108 |
|
---|
[c48c555] | 109 | <varlistentry os="dg4">
|
---|
[bf8c11f] | 110 | <term><parameter>RANLIB="${LFS_TARGET}-ranlib"</parameter></term>
|
---|
| 111 | <listitem>
|
---|
[b09f8ce] | 112 | <para>This forces Glibc to use the <command>ranlib</command> utility
|
---|
| 113 | we made for our target architecture.</para>
|
---|
[bf8c11f] | 114 | </listitem>
|
---|
| 115 | </varlistentry>
|
---|
| 116 |
|
---|
[c48c555] | 117 | <varlistentry os="dg5">
|
---|
[bf8c11f] | 118 | <term><parameter>--disable-profile</parameter></term>
|
---|
| 119 | <listitem>
|
---|
[c48c555] | 120 | <para>This builds the libraries without profiling information.
|
---|
| 121 | Omit this option if profiling on the temporary tools is necessary.</para>
|
---|
[bf8c11f] | 122 | </listitem>
|
---|
| 123 | </varlistentry>
|
---|
| 124 |
|
---|
[c48c555] | 125 | <varlistentry os="dg6">
|
---|
[bf8c11f] | 126 | <term><parameter>--enable-add-ons</parameter></term>
|
---|
| 127 | <listitem>
|
---|
[138b95d] | 128 | <para>This tells Glibc to utilize all add-ons that are
|
---|
| 129 | available.</para>
|
---|
[bf8c11f] | 130 | </listitem>
|
---|
| 131 | </varlistentry>
|
---|
| 132 |
|
---|
[c48c555] | 133 | <varlistentry os="dg7">
|
---|
[bf8c11f] | 134 | <term><parameter>--with-tls</parameter></term>
|
---|
| 135 | <listitem>
|
---|
[cbfa0a3] | 136 | <para>This tells Glibc to use Thread Local Storage.</para>
|
---|
[bf8c11f] | 137 | </listitem>
|
---|
| 138 | </varlistentry>
|
---|
| 139 |
|
---|
[c48c555] | 140 | <varlistentry os="dg8">
|
---|
[bf8c11f] | 141 | <term><parameter>--with-__thread</parameter></term>
|
---|
| 142 | <listitem>
|
---|
[cbfa0a3] | 143 | <para>This tells Glibc to use use the __thread for libc and
|
---|
[c48c555] | 144 | libpthread builds.</para>
|
---|
[bf8c11f] | 145 | </listitem>
|
---|
| 146 | </varlistentry>
|
---|
| 147 |
|
---|
[c48c555] | 148 | <varlistentry os="dg9">
|
---|
[bf8c11f] | 149 | <term><parameter>--with-binutils=/cross-tools/bin</parameter></term>
|
---|
| 150 | <listitem>
|
---|
[cbfa0a3] | 151 | <para>This tells Glibc to use the Binutils that are specific to
|
---|
[c48c555] | 152 | our target architecture.</para>
|
---|
[bf8c11f] | 153 | </listitem>
|
---|
| 154 | </varlistentry>
|
---|
| 155 |
|
---|
[c48c555] | 156 | <varlistentry os="dg10">
|
---|
[bf8c11f] | 157 | <term><parameter>--cache-file=config.cache</parameter></term>
|
---|
| 158 | <listitem>
|
---|
[cbfa0a3] | 159 | <para>This tells Glibc to utilize a premade cache file.</para>
|
---|
[bf8c11f] | 160 | </listitem>
|
---|
| 161 | </varlistentry>
|
---|
| 162 |
|
---|
| 163 | </variablelist>
|
---|
| 164 |
|
---|
[c48c555] | 165 | <para os="dh">During this stage the following warning might appear:</para>
|
---|
[bf8c11f] | 166 |
|
---|
[c48c555] | 167 | <blockquote os="di"><screen><computeroutput>configure: WARNING:
|
---|
[bf8c11f] | 168 | *** These auxiliary programs are missing or
|
---|
| 169 | *** incompatible versions: msgfmt
|
---|
| 170 | *** some features will be disabled.
|
---|
| 171 | *** Check the INSTALL file for required versions.</computeroutput></screen></blockquote>
|
---|
| 172 |
|
---|
[c48c555] | 173 | <para os="dj">The missing or incompatible <command>msgfmt</command> program is
|
---|
[bf8c11f] | 174 | generally harmless. This <command>msgfmt</command> program is part of the
|
---|
| 175 | Gettext package which the host distribution should provide.</para>
|
---|
| 176 |
|
---|
[c48c555] | 177 | <para os="dk">Compile the package:</para>
|
---|
[bf8c11f] | 178 |
|
---|
[c48c555] | 179 | <screen os="dl"><userinput>make</userinput></screen>
|
---|
[bf8c11f] | 180 |
|
---|
[c48c555] | 181 | <para os="dm">Install the package:</para>
|
---|
[bf8c11f] | 182 |
|
---|
[c48c555] | 183 | <screen os="dn"><userinput>make install</userinput></screen>
|
---|
[bf8c11f] | 184 |
|
---|
| 185 | </sect2>
|
---|
| 186 |
|
---|
| 187 | <sect2 role="content">
|
---|
| 188 | <title/>
|
---|
| 189 |
|
---|
| 190 | <para>Details on this package are located in <xref
|
---|
| 191 | linkend="contents-glibc" role="."/></para>
|
---|
| 192 |
|
---|
| 193 | </sect2>
|
---|
| 194 |
|
---|
| 195 | </sect1>
|
---|