2 % This is part of LFSbookja package.
4 % This is a CTIE change file for the original XML source of the LFSbook.
7 <?xml version="1.0" encoding="ISO-8859-1"?>
9 <?xml version="1.0" encoding="UTF-8"?>
13 <sect1 id="ch-tools-gcc-pass1" role="wrap" xreflabel="gcc-pass1">
15 <sect1 id="ch-tools-gcc-pass1" role="wrap" xreflabel="gcc 1 回め">
19 <title>GCC-&gcc-version; - Pass 1</title>
21 <title>GCC-&gcc-version; - 1回め</title>
25 <indexterm zone="ch-tools-gcc-pass1">
26 <primary sortas="a-GCC">GCC</primary>
27 <secondary>tools, pass 1</secondary>
30 <indexterm zone="ch-tools-gcc-pass1">
31 <primary sortas="a-GCC">GCC</primary>
32 <secondary>&Tools;, 1回め</secondary>
37 <title>Installation of Cross GCC</title>
39 <title>&InstallationOf1;クロスコンパイル版 GCC&InstallationOf2;</title>
43 <para>GCC requires the GMP, MPFR and MPC packages. As these packages may
44 not be included in your host distribution, they will be built with
45 GCC. Unpack each package into the GCC source directory and rename the
46 resulting directories so the GCC build procedures will automatically
50 GCC は GMP、MPFR、MPC の各パッケージを必要とします。
51 これらのパッケージはホストシステムに含まれていないかもしれないため、以下を実行してビルドの準備をします。
52 個々のパッケージを GCC ソースディレクトリの中に伸張 (解凍) し、ディレクトリ名を変更します。
53 これは GCC のビルド処理においてそれらを自動的に利用できるようにするためです。
58 <note><para>There are frequent misunderstandings about this chapter. The
59 procedures are the same as every other chapter as explained earlier (<xref
60 linkend='buildinstr'/>). First extract the gcc tarball from the sources
61 directory and then change to the directory created. Only then should you
62 proceed with the instructions below.</para></note>
66 ここでの手順は他のものと同様であり、手順の概要 (<xref linkend='buildinstr'/>) は説明済です。
67 まず初めに gcc の tarball を伸張 (解凍) し、生成されたソースディレクトリに移動します。
68 それに加えて本節では、以下の手順を行うものとなります。
73 <para>On x86_64 hosts, set the default directory name for
74 64-bit libraries to <quote>lib</quote>:</para>
77 x86_64 ホストにおいて、64 ビットライブラリに対するデフォルトのディレクトリ名は<quote>lib</quote>です。
82 <para>The GCC documentation recommends building GCC
83 in a dedicated build directory:</para>
86 GCC のドキュメントでは、専用のビルドディレクトリを作成することが推奨されています。
91 <para>Prepare GCC for compilation:</para>
93 <para>&PreparePackage1;GCC&PreparePackage2;</para>
97 <title>The meaning of the configure options:</title>
99 <title>&MeaningOfOption1;configure&MeaningOfOption2;</title>
102 @x --with-glibc-version=&glibc-version;
103 <para>This option specifies the version of glibc which will be
104 used on the target. It is not relevant to the libc of the host
105 distro because everything compiled by pass1 gcc will run in the
106 chroot environment, which is isolated from libc of the host
110 このオプションは、ターゲットにおいて用いられることになる glibc のバージョンを指定します。
111 これはホストディストリビューションにある libc のバージョンとは関係がありません。
112 1 回めの gcc によってコンパイルされるものは、すべて chroot 環境内で実行されるものであって、ホストにある libc とは切り離されているためです。
117 <para>Since a working C library is not yet available, this ensures
118 that the inhibit_libc constant is defined when building libgcc. This prevents
119 the compiling of any code that requires libc support.</para>
122 この時点では利用可能な C ライブラリがまだ存在しません。
123 したがって libgcc のビルド時に inhibit_libc 定数を定義します。
124 これを行うことで、libc サポートを必要とするコード部分をコンパイルしないようにします。
129 <para>When creating a complete cross-compiler, GCC requires
130 standard headers compatible with the target system. For our
131 purposes these headers will not be needed. This switch prevents
132 GCC from looking for them.</para>
135 完璧なクロスコンパイラーを構築するなら、GCC はターゲットシステムに互換性を持つ標準ヘッダーを必要とします。
136 本手順においては標準ヘッダーは必要ありません。
137 このスイッチは GCC がそういったヘッダーを探しにいかないようにします。
142 <para>This switch forces GCC to link its internal libraries
143 statically. We need this because the shared libraries require glibc,
144 which is not yet installed on the target system.</para>
147 このスイッチは内部ライブラリをスタティックライブラリとしてリンクすることを指示します。
148 共有ライブラリが glibc を必要としており、処理しているシステム上にはまだインストールされていないためです。
152 @x --disable-multilib
153 <para>On x86_64, LFS does not support a multilib configuration.
154 This switch is harmless for x86.</para>
157 x86_64 に対して LFS は multilib のサポートをしていません。
158 このオプション指定は x86 には無関係です。
162 @x --disable-decimal-float, --disable-threads, --disable-libatomic, --disable-libgomp, --disable-libquadmath, --disable-libssp, --disable-libvtv, --disable-libstdcxx
163 <para>These switches disable support for the decimal floating point
164 extension, threading, libatomic, libgomp, libquadmath, libssp,
165 libvtv, and the C++ standard library respectively. These features
166 will fail to compile when building a cross-compiler and are not
167 necessary for the task of cross-compiling the temporary libc.</para>
170 これらのオプションは順に、十進浮動小数点制御、スレッド処理、libatomic, libgomp, libquadmath, libssp, libvtv, C++ 標準ライブラリのサポートをいずれも無効にすることを指示します。
171 これらの機能を含めていると、クロスコンパイラーをビルドする際にはコンパイルに失敗します。
172 またクロスコンパイルによって一時的な libc ライブラリを構築する際には不要なものです。
176 @x --enable-languages=c,c++
177 <para>This option ensures that only the C and C++ compilers are built.
178 These are the only languages needed now.</para>
181 このオプションは C コンパイラーおよび C++ コンパイラーのみビルドすることを指示します。
182 この時点で必要なのはこの言語だけだからです。
187 <para>Compile GCC by running:</para>
189 <para>GCC をコンパイルします。</para>
193 <para>Install the package:</para>
195 <para>&InstallThePackage;</para>
199 <para>This build of GCC has installed a couple of internal system
200 headers. Normally one of them, <filename>limits.h</filename>, would in turn
201 include the corresponding system <filename>limits.h</filename> header, in
202 this case, <filename>$LFS/usr/include/limits.h</filename>. However, at the
203 time of this build of GCC <filename>$LFS/usr/include/limits.h</filename>
204 does not exist, so the internal header that has just been installed is a
205 partial, self-contained file and does not include the extended features of
206 the system header. This is adequate for building glibc, but the full
207 internal header will be needed later. Create a full version of the internal
208 header using a command that is identical to what the GCC build system does
209 in normal circumstances:</para>
212 ここでの GCC ビルドにおいては、内部にあるシステムヘッダーファイルをいくつかインストールしました。
213 そのうちの <filename>limits.h</filename> というものは、対応するシステムヘッダーファイルである <filename>limits.h</filename> を読み込むものになっています。
214 そのファイルはここでは <filename>$LFS/usr/include/limits.h</filename> になります。
215 ただし GCC をビルドしたこの時点において <filename>$LFS/usr/include/limits.h</filename> は存在していません。
216 したがってインストールされたばかりの内部ヘッダーファイルは、部分的に自己完結したファイルとなり、システムヘッダーファイルによる拡張された機能を含むものになっていません。
217 glibc をビルドする際にはこれでもかまわないのですが、後々内部ヘッダーファイルは完全なものが必要になります。
218 以下のようなコマンドを通じて、その内部ヘッダーファイルの完成版を作り出します。
219 このコマンドは GCC ビルドが通常行っている方法と同じものです。
224 <para>Details on this package are located in
225 <xref linkend="contents-gcc" role="."/></para>
228 &Details1;<xref linkend="contents-gcc" role=""/>&Details2;