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 <indexterm zone="ch-tools-glibc">
14 <primary sortas="a-Glibc">Glibc</primary>
15 <secondary>tools</secondary>
18 <indexterm zone="ch-tools-glibc">
19 <primary sortas="a-Glibc">Glibc</primary>
20 <secondary>&Tools;</secondary>
25 <title>Installation of Glibc</title>
27 <title>&InstallationOf1;Glibc&InstallationOf2;</title>
31 <para>First, create a symbolic link for LSB compliance. Additionally,
32 for x86_64, create a compatibility symbolic link required for proper
33 operation of the dynamic library loader:</para>
36 はじめに LSB コンプライアンスに合うように、シンボリックリンクを生成します。
37 さらに x86_64 向けとして、互換のシンボリックリンクを生成して、ダイナミックライブラリローダーが適切に動作するようにします。
42 The above command is correct. The <command>ln</command> command has
43 a few syntactic versions, so be sure to check
44 <command>info coreutils ln</command> and <filename>ln(1)</filename>
45 before reporting what you may think is an error.
48 <command>ln</command> コマンドにはいくつか文法の異なるバージョンがあります。
49 間違いがあると思った場合には <command>info coreutils ln</command> や <filename>ln(1)</filename> をよく確認してください。
53 <para>Some of the Glibc programs use the non-FHS compliant
54 <filename class="directory">/var/db</filename> directory to store their
55 runtime data. Apply the following patch to make such programs store their
56 runtime data in the FHS-compliant locations:</para>
59 Glibc のプログラムの中で、FHS コンプライアンスに適合しない <filename
60 class="directory">/var/db</filename> ディレクトリを用いているものがあり、そこに実行時データを保存しています。
61 以下のパッチを適用することで、実行時データの保存ディレクトリを FHS に合致するものとします。
66 <para>The Glibc documentation recommends building Glibc
67 in a dedicated build directory:</para>
70 Glibc のドキュメントでは、専用のビルドディレクトリを作成することが推奨されています。
75 <para>Ensure that the <command>ldconfig</command> and <command>sln</command>
76 utilities are installed into
77 <filename class="directory">/usr/sbin</filename>:</para>
80 <command>ldconfig</command> と <command>sln</command> ユーティリティーを <filename
81 class="directory">/usr/sbin</filename> にインストールするようにします。
86 <para>Next, prepare Glibc for compilation:</para>
89 次に Glibc をコンパイルするための準備をします。
94 <title>The meaning of the configure options:</title>
96 <title>&MeaningOfOption1;configure&MeaningOfOption2;</title>
99 @x --host=$LFS_TGT, --build=$(../glibc-&glibc-version;/scripts/config.guess)
100 <para>The combined effect of these switches is that Glibc's build system
101 configures itself to be cross-compiled, using the cross-linker and
102 cross-compiler in <filename class="directory">$LFS/tools</filename>.</para>
105 このようなオプションを組み合わせることで <filename
106 class="directory">/tools</filename> ディレクトリにあるクロスコンパイラー、クロスリンカーを使って Glibc がクロスコンパイルされるようになります。
111 <para>This tells Glibc to compile the library with support
112 for &min-kernel; and later Linux kernels. Workarounds for older
113 kernels are not enabled.</para>
116 Linux カーネル &min-kernel; 以上のサポートを行うよう指示します。
117 これ以前のカーネルは利用することができません。
121 @x --with-headers=$LFS/usr/include
122 <para>This tells Glibc to compile itself against the headers
123 recently installed to the $LFS/usr/include directory, so that
124 it knows exactly what features the kernel has and can optimize
125 itself accordingly.</para>
128 これまでに $LFS/usr/include ディレクトリにインストールしたヘッダーファイルを用いて Glibc をビルドすることを指示します。
129 こうすればカーネルにどのような機能があるか、どのようにして処理効率化を図れるかなどの情報を Glibc が得られることになります。
133 @x libc_cv_slibdir=/usr/lib
134 <para>This ensures that the library is installed in /usr/lib instead
135 of the default /lib64 on 64 bit machines.</para>
138 この指定は 64 ビットマシンにおいて、ライブラリのインストール先をデフォルトの /lib64 ではなく /usr/lib とします。
142 %@x libc_cv_include_x86_isa_level=no
143 % <para>This disables <quote>x86 ISA needed</quote> property in
144 % Glibc libraries. Use it <emphasis role="bold">if</emphasis>
145 % you are building Glibc with <option>-march</option> option in
146 % <envar>CFLAGS</envar>, to workaround an issue in Glibc-2.33
147 % breaking it.</para>
150 % これは Glibc ライブラリ内の<quote>x86 ISA needed</quote>プロパティを無効にします。
151 % Glibc のビルド時に <envar>CFLAGS</envar> として <option>-march</option> を設定している <emphasis
152 % role="bold">場合に限っては</emphasis> これを有効にします。
153 % そうすることで Glibc-2.33 における問題が回避できます。
158 <para>During this stage the following warning might appear:</para>
161 ビルド中には以下のようなメッセージが出力されるかもしれません。
166 <para>The missing or incompatible <command>msgfmt</command> program is
167 generally harmless. This <command>msgfmt</command> program is part of the
168 Gettext package which the host distribution should provide.</para>
171 <command>msgfmt</command> プログラムがない場合 (missing) や互換性がない場合 (incompatible) でも特に問題はありません。
172 <command>msgfmt</command> プログラムは Gettext パッケージが提供するもので、ホストシステムに含まれているかもしれません。
177 <note><para>There have been reports that this package may fail when
178 building as a "parallel make". If this occurs, rerun the make command
179 with a "-j1" option.</para></note>
181 <note><para>本パッケージは "並行ビルド (parallel make)" を行うとビルドに失敗するとの報告例があります。
182 もしビルドに失敗した場合は make コマンドに "-j1" オプションをつけて再ビルドしてください。
187 <para>Compile the package:</para>
189 <para>&CompileThePackage;</para>
193 <para>Install the package:</para>
195 <para>&InstallThePackage;</para>
199 <warning><para>If <envar>LFS</envar> is not properly set, and despite the
200 recommendations, you are building as
201 <systemitem class="username">root</systemitem>, the next command will
202 install the newly built glibc to your host system, which most likely
203 will render it unusable. So double check that the environment is
204 correctly set, before running the following command.</para></warning>
207 <envar>LFS</envar> が適切に設定されていない状態で、推奨する方法とは異なり <systemitem class="username">root</systemitem> によってビルドを行うと、次のコマンドはビルドした glibc をホストシステムにインストールしてしまいます。
208 これを行ってしまうと、ほぼ間違いなくホストが利用不能になります。
209 したがってその環境変数が適切に設定されていることを確認してから、以下のコマンドを実行してください。
214 <title>The meaning of the <command>make install</command> option:</title>
216 <title>&MeaningOfOption1;<command>make install</command>&MeaningOfOption2;</title>
220 <para>The <envar>DESTDIR</envar> make variable is used by almost all
221 packages to define the location where the package should be
222 installed. If it is not set, it defaults to the root (<filename
223 class="directory">/</filename>) directory. Here we specify that
224 the package be installed in <filename class="directory">$LFS
225 </filename>, which will become the root after <xref linkend=
226 "ch-tools-chroot"/>.</para>
229 make 変数 <envar>DESTDIR</envar> はほとんどすべてのパッケージにおいて、そのパッケージをインストールするディレクトリを定義するために利用されています。
230 これが設定されていない場合のデフォルトは、ルートディレクトリ(<filename
231 class="directory">/</filename>)となります。
232 ここではパッケージのインストール先を <filename
233 class="directory">$LFS</filename> とします。
234 これは <xref linkend="ch-tools-chroot"/> に入ってからはルートディレクトリとなります。
239 <para>Fix hardcoded path to the executable loader in
240 <command>ldd</command> script:</para>
243 <command>ldd</command> スクリプト内にある実行可能なローダーへのパスがハードコーディングされているので、これを修正します。
248 <para>At this point, it is imperative to stop and ensure that the basic
249 functions (compiling and linking) of the new toolchain are working as
250 expected. To perform a sanity check, run the following commands:</para>
254 新しいツールチェーンの基本的な機能 (コンパイルやリンク) が正常に処理されるかどうかを確認することです。
255 健全性のチェック (sanity check) を行うものであり、以下のコマンドを実行します。
260 <para>If everything is working correctly, there should be no errors,
261 and the output of the last command will be of the form:</para>
264 すべてが正常に処理され、エラーが発生しなければ、最終のコマンドの実行結果として以下が出力されるはずです。
269 <para>Note that for 32-bit machines, the interpreter name will be
270 <filename>/lib/ld-linux.so.2</filename>.</para>
273 インタープリター名は 32 ビットマシンの場合 <filename>/lib/ld-linux.so.2</filename> となります。
278 <para>If the output is not shown as above or there was no output at all,
279 then something is wrong. Investigate and retrace the steps to find out
280 where the problem is and correct it. This issue must be resolved before
281 continuing on.</para>
284 出力結果が上とは異なったり、あるいは何も出力されなかったりした場合は、どこかに不備があります。
285 どこに問題があるのか調査、再試行を行って解消してください。
291 <para>Once all is well, clean up the test files:</para>
294 すべてが完了したら、テストファイルを削除します。
299 <note><para>Building packages in the next chapter will serve as an
300 additional check that the toolchain has been built properly. If some
301 package, especially binutils-pass2 or gcc-pass2, fails to build, it is
302 an indication that something has gone wrong with the
303 previous Binutils, GCC, or Glibc installations.</para></note>
306 次節にてビルドするパッケージでは、ツールチェーンが正しく構築できたかどうかを再度チェックすることになります。
307 特に binutils 2 回めや gcc 2 回めのビルドに失敗したら、それ以前にインストールしてきた binutils, GCC, glibc のいずれかにてビルドがうまくできていないことを意味します。
312 <para>Now that our cross-toolchain is complete, finalize the installation
313 of the limits.h header. For doing so, run a utility provided by the GCC
317 ここでクロスツールチェーンが完成しました。
318 そこで limits.h のインストールを確定させます。
319 これには GCC 開発者が提供するユーティリティーを実行します。
324 <para>Details on this package are located in
325 <xref linkend="contents-glibc" role="."/></para>
328 &Details1;<xref linkend="contents-glibc" role=""/>&Details2;