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 <para>The GCC package contains the GNU compiler collection, which includes
14 the C and C++ compilers.</para>
17 GCC パッケージは C コンパイラーや C++ コンパイラーなどの GNU コンパイラーコレクションを提供します。
22 <title>Installation of GCC</title>
24 <title>&InstallationOf1;GCC&InstallationOf2;</title>
28 <para>At first, fix an issue breaking
29 <filename class="libraryfile">libasan.a</filename> building this package
30 with Glibc-2.34 or later:</para>
33 はじめに Glibc-2.34 またはそれ以降を使った際に、本パッケージの <filename
34 class="libraryfile">libasan.a</filename> ビルドが不適切になる問題を修正します。
39 <para>If building on x86_64, change the default directory name for 64-bit
40 libraries to <quote>lib</quote>:</para>
43 x86_64 上でビルドしている場合は、64ビットライブラリのデフォルトディレクトリ名を "lib"にします。
48 <para>The GCC documentation recommends building GCC in a dedicated build directory:</para>
51 GCC のドキュメントによると GCC のビルドにあたっては、専用のビルドディレクトリを作成することが推奨されています。
56 <para>Prepare GCC for compilation:</para>
58 <para>&PreparePackage1;GCC&PreparePackage2;</para>
62 <para>Note that for other programming languages there are some prerequisites that
63 are not yet available. See the
64 <ulink url="&blfs-book;general/gcc.html">BLFS Book GCC page</ulink>
65 for instructions on how to build all of GCC's supported languages.</para>
68 他のプログラミング言語は、また別の依存パッケージなどを要しますが、現時点では準備できていません。
69 GCC がサポートする他のプログラム言語の構築方法については <ulink
70 url="&blfs-book;general/gcc.html">BLFS ブック</ulink> の説明を参照してください。
75 <title>The meaning of the new configure parameters:</title>
77 <title>&MeaningOfParameter1;Configure&MeaningOfParameter2;</title>
81 <para>This parameter makes the configure script use the ld installed
82 by the binutils built earlier in this chapter, rather than
83 the cross-built version which would otherwise be used.</para>
86 本パラメーターは、本章の初期段階でビルドした binutils の ld を使うことを configure スクリプトに指示します。
87 これを指定しなかった場合は、クロスビルド版のものが用いられることになります。
92 <para>This switch tells GCC to link to the system installed copy of
93 the zlib library, rather than its own internal copy.</para>
96 このオプションはシステムに既にインストールされている zlib ライブラリをリンクすることを指示するものであり、内部にて作成されるライブラリを用いないようにします。
101 <para>Compile the package:</para>
103 <para>&CompileThePackage;</para>
107 <para>In this section, the test suite for GCC is considered
108 important, but it takes a long time. First time builders are
109 encouraged to not skip it. The time to run the tests can be
110 reduced significantly by adding -jx to the make command below
111 where x is the number of cores on your system.</para>
114 本節における GCC のテストスイートは極めて重要なものです。
116 初めてビルドを行う方には、必ず実施することをお勧めします。
117 テスト実行に要する時間は、make コマンドに -jx をつけることで、かなり削減できます。
118 ここに示す x には、システムのコア数を指定するものです。
123 <para>One set of tests in the GCC test suite is known to exhaust the default
124 stack, so increase the stack size prior to running the tests:</para>
127 GCC テストスイートの中で、デフォルトのスタックを使い果たすものがあります。
128 そこでテスト実施にあたり、スタックサイズを増やします。
133 <para>Test the results as a non-privileged user, but do not stop at errors:</para>
137 ただしエラーがあっても停止しないようにします。
142 <para>To receive a summary of the test suite results, run:</para>
145 テスト結果を確認するために以下を実行します。
150 <para>For only the summaries, pipe the output through
151 <userinput>grep -A7 Summ</userinput>.</para>
154 テスト結果の概略のみ確認したい場合は、出力結果をパイプ出力して <userinput>grep -A7 Summ</userinput> を実行してください。
159 <para>Results can be compared with those located at <ulink
160 url="&test-results;"/> and
161 <ulink url="https://gcc.gnu.org/ml/gcc-testresults/"/>.</para>
165 url="&test-results;"/> と <ulink
166 url="https://gcc.gnu.org/ml/gcc-testresults/"/> にある情報と比較することができます。
171 <para>Eight tests related to analyzer are known to fail.</para>
174 アナライザーに関するテストが 8 つ失敗します。
179 <para>One test named <filename>asan_test.C</filename> is known to
183 <filename>asan_test.C</filename> というテストが 1 つ失敗します。
188 <para>In libstdc++, one test named <filename>49745.cc</filename> is
189 known to fail because the header dependencies in glibc have
193 libstdc++ において <filename>49745.cc</filename> というテストが 1 つ失敗します。
194 これは glibc 内ヘッダーの依存関係が変更されているからです。
199 <para>In libstdc++, one numpunct test and six tests related to get_time are
200 known to fail. These are all because the locale definitions in glibc have
201 changed but libstdc++ does not currently support those changes.</para>
204 libstdc++ においては、numpunct のテスト 1 つと get_time に関連するテストが 6 つ失敗します。
205 この理由は、glibc におけるロケール定義が変更されているからであり、libstdc++ はその変更に対応していないためです。
210 <para>A few unexpected failures cannot always be avoided. The GCC developers
211 are usually aware of these issues, but have not resolved them yet.
212 Unless the test results are vastly different from those at the above URL,
213 it is safe to continue.</para>
216 テストに失敗することがありますが、これを回避することはできません。
217 GCC の開発者はこの問題を認識していますが、まだ解決していない状況です。
218 上記の URL に示されている結果と大きく異なっていなかったら、問題はありませんので先に進んでください。
223 On some combinations of kernel configuration and AMD processors
224 there may be more than 1100 failures in the gcc.target/i386/mpx
225 tests (which are designed to test the MPX option on recent
226 Intel processors). These can safely be ignored on AMD
227 processors. These tests will also fail on Intel processors if MPX support
228 is not enabled in the kernel even though it is present on the CPU.
230 カーネル設定の組み合わせにより、あるいは AMD プロセッサーを利用している場合に、gcc.target/i386/mpx に関するテストが 1100 個以上失敗します。
231 (これは最新の Intel プロセッサーにおいて MPX オプションをテストするものです。)
232 AMD プロセッサーを利用している場合は無視して構いません。
233 上のテストは Inter プロセッサーであっても、カーネル上にて MPX サポートが無効になっていると、たとえ CPU がサポートしていても発生します。
237 <para>Install the package and remove an unneeded directory:</para>
246 <para>The GCC build directory is owned by <systemitem class="username">
247 tester</systemitem> now and the ownership of the installed header
248 directory (and its content) will be incorrect. Change the ownership to
249 <systemitem class="username">root</systemitem> user and group:</para>
252 GCC のビルドディレクトリの所有者は <systemitem class="username">
253 tester</systemitem> であるため、ヘッダーがインストールされるディレクトリ(とその内容)に対する所有権が不適切なものになります。
254 そこでその所有権を <systemitem class="username">root</systemitem> ユーザーとグループに変更します。
259 <para>Create a symlink required by the <ulink
260 url="https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s09.html">FHS</ulink>
261 for "historical" reasons.</para>
264 <ulink url="https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s09.html">FHS</ulink>
265 の求めるところに応じてシンボリックリンクを作成します。
271 <para>Many packages use the name <command>cc</command> to call the C
272 compiler. To satisfy those packages, create a symlink:</para>
275 各種パッケージは C コンパイラーとして <command>cc</command> を呼び出しているものが数多くあります。
276 これに対応するため、以下のシンボリックリンクを作成します。
281 <para>Add a compatibility symlink to enable building programs with
282 Link Time Optimization (LTO):</para>
285 リンク時の最適化 (Link Time Optimization; LTO) によりプログラム構築できるように、シンボリックリンクを作ります。
290 <para>Now that our final toolchain is in place, it is important to again ensure
291 that compiling and linking will work as expected. We do this by performing
292 some sanity checks:</para>
295 最終的なツールチェーンが出来上がりました。
296 ここで再びコンパイルとリンクが正しく動作することを確認することが必要です。
302 <para>There should be no errors,
303 and the output of the last command will be (allowing for
304 platform-specific differences in the dynamic linker name):</para>
307 問題なく動作するはずで、最後のコマンドから出力される結果は以下のようになるはずです。
308 (ダイナミックリンカーの名前はプラットフォームによって違っているかもしれません。)
313 <para>Now make sure that we're setup to use the correct start files:</para>
316 ここで起動ファイルが正しく用いられていることを確認します。
321 <para>The output of the last command should be:</para>
324 上のコマンドの出力は以下のようになるはずです。
329 <para>Depending on your machine architecture, the above may differ slightly.
330 The difference will be the name of the directory
331 after <filename class="directory">/usr/lib/gcc</filename>. The important
332 thing to look for here is that <command>gcc</command> has found all three
333 <filename>crt*.o</filename> files under the
334 <filename class="directory">/usr/lib</filename> directory.</para>
337 作業しているマシンアーキテクチャーによっては、上の結果が微妙に異なるかもしれません。
338 その違いは、たいていは <filename class="directory">/usr/lib/gcc</filename> の次のディレクトリ名にあります。
339 注意すべき重要な点は <command>gcc</command> が <filename>crt*.o</filename> という 3 つのファイルを <filename
340 class="directory">/usr/lib</filename> 配下から探し出しているということです。
345 <para>Verify that the compiler is searching for the correct header
349 コンパイラーが正しいヘッダーファイルを読み取っているかどうかを検査します。
354 <para>This command should return the following output:</para>
362 <para>Again, the directory named after your target triplet may be
363 different than the above, depending on your system architecture.</para>
366 もう一度触れておきますが、プラットフォームの<quote>三つの組 (target triplet)</quote>の次にくるディレクトリ名は CPU アーキテクチャーにより異なる点に注意してください。
371 <para>Next, verify that the new linker is being used with the correct search paths:</para>
374 次に、新たなリンカーが正しいパスを検索して用いられているかどうかを検査します。
379 <para>References to paths that have components with '-linux-gnu' should
380 be ignored, but otherwise the output of the last command should be:</para>
383 '-linux-gnu' を含んだパスは無視すれば、最後のコマンドの出力は以下となるはずです。
388 % <note><para>As of version 4.3.0, GCC now unconditionally installs the
389 % <filename>limits.h</filename> file into the private
390 % <filename class="directory">include-fixed</filename> directory, and that
391 % directory is required to be in place.</para></note>
394 % GCC のバージョン 4.3.0 では <filename>limits.h</filename> ファイルを無条件に <filename
395 % class="directory">include-fixed</filename> ディレクトリにインストールします。
396 % したがってそのディレクトリは存在していなければなりません。
401 <para>A 32-bit system may see a few different directories. For example, here
402 is the output from an i686 machine:</para>
405 32ビットシステムではディレクトリが多少異なります。
411 <para>Next make sure that we're using the correct libc:</para>
414 次に libc が正しく用いられていることを確認します。
419 <para>The output of the last command should be:</para>
422 最後のコマンドの出力は以下のようになるはずです。
427 <para>Make sure GCC is using the correct dynamic linker:</para>
430 GCC が正しくダイナミックリンカーを用いているかを確認します。
435 <para>The output of the last command should be (allowing for
436 platform-specific differences in dynamic linker name):</para>
439 上のコマンドの出力は以下のようになるはずです。
440 (ダイナミックリンカーの名前はプラットフォームによって違っているかもしれません。)
445 <para>If the output does not appear as shown above or is not received
446 at all, then something is seriously wrong. Investigate and retrace the
447 steps to find out where the problem is and correct it. <!--The most likely
448 reason is that something went wrong with the specs file adjustment.--> Any
449 issues will need to be resolved before continuing with the process.</para>
452 出力結果が上と異なっていたり、出力が全く得られなかったりした場合は、何かが根本的に間違っているということです。
453 どこに問題があるのか調査、再試行を行って解消してください。
454 問題を残したままこの先には進まないでください。
459 <para>Once everything is working correctly, clean up the test files:</para>
462 すべてが正しく動作したら、テストに用いたファイルを削除します。
467 <para>Finally, move a misplaced file:</para>
470 最後に誤ったディレクトリにあるファイルを移動します。
475 <title>Contents of GCC</title>
477 <title>&ContentsOf1;GCC&ContentsOf2;</title>
481 <segtitle>Installed programs</segtitle>
482 <segtitle>Installed libraries</segtitle>
483 <segtitle>Installed directories</segtitle>
485 <segtitle>&InstalledProgram;</segtitle>
486 <segtitle>&InstalledLibrary;</segtitle>
487 <segtitle>&InstalledDirectory;</segtitle>
491 <seg>c++, cc (link to gcc), cpp, g++, gcc,
492 gcc-ar, gcc-nm, gcc-ranlib, gcov, gcov-dump, gcov-tool,
495 <seg>libasan.{a,so}, libatomic.{a,so}, libcc1.so, libgcc.a, libgcc_eh.a,
496 libgcc_s.so, libgcov.a, libgomp.{a,so}, libitm.{a,so},
497 liblsan.{a,so}, liblto_plugin.so,
498 libquadmath.{a,so}, libssp.{a,so}, libssp_nonshared.a,
499 libstdc++.{a,so}, libstdc++fs.a, libsupc++.a, libtsan.{a,so},
500 and libubsan.{a,so}</seg>
502 <seg>/usr/include/c++, /usr/lib/gcc, /usr/libexec/gcc, and
503 /usr/share/gcc-&gcc-version;</seg>
505 <seg>c++, cc (gcc へのリンク), cpp, g++, gcc,
506 gcc-ar, gcc-nm, gcc-ranlib, gcov, gcov-dump, gcov-tool,
509 <seg>libasan.{a,so}, libatomic.{a,so}, libcc1.so, libgcc.a, libgcc_eh.a,
510 libgcc_s.so, libgcov.a, libgomp.{a,so}, libitm.{a,so},
511 liblsan.{a,so}, liblto_plugin.so,
512 libquadmath.{a,so}, libssp.{a,so}, libssp_nonshared.a,
513 libstdc++.{a,so}, libstdc++fs.a, libsupc++.a, libtsan.{a,so},
514 libubsan.{a,so}</seg>
516 <seg>/usr/include/c++, /usr/lib/gcc, /usr/libexec/gcc,
517 /usr/share/gcc-&gcc-version;</seg>
521 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
523 <bridgehead renderas="sect3">&ShortDescriptions;</bridgehead>
527 <para>The C++ compiler</para>
529 <para>C++ コンパイラー</para>
533 <para>The C compiler</para>
535 <para>C コンパイラー</para>
539 <para>The C preprocessor; it is used by the compiler to expand the
540 #include, #define, and similar statements in the source files</para>
544 コンパイラーがこれを利用して、ソース内に記述された #include、#define や同じようなステートメントを展開します。
549 <para>The C++ compiler</para>
551 <para>C++ コンパイラー</para>
555 <para>The C compiler</para>
557 <para>C コンパイラー</para>
561 <para>A wrapper around <command>ar</command> that adds a
562 plugin to the command line. This program is only used
563 to add "link time optimization" and is not useful with the
564 default build options</para>
567 <command>ar</command> に関連するラッパーであり、コマンドラインへのプラグインを追加します。
568 このプログラムは「リンク時の最適化 (link time optimization)」機能を付与する場合にのみ利用されます。
569 デフォルトのビルドオプションでは有効にはなりません。
574 <para>A wrapper around <command>nm</command> that adds a
575 plugin to the command line. This program is only used
576 to add "link time optimization" and is not useful with the
577 default build options</para>
580 <command>nm</command> に関連するラッパーであり、コマンドラインへのプラグインを追加します。
581 このプログラムは「リンク時の最適化 (link time optimization)」機能を付与する場合にのみ利用されます。
582 デフォルトのビルドオプションでは有効にはなりません。
587 <para>A wrapper around <command>ranlib</command> that adds a
588 plugin to the command line. This program is only used
589 to add "link time optimization" and is not useful with the
590 default build options</para>
593 <command>ranlib</command> に関連するラッパーであり、コマンドラインへのプラグインを追加します。
594 このプログラムは「リンク時の最適化 (link time optimization)」機能を付与する場合にのみ利用されます。
595 デフォルトのビルドオプションでは有効にはなりません。
600 <para>A coverage testing tool; it is used to analyze programs to
601 determine where optimizations will have the most effect</para>
605 プログラムを解析して、最適化が最も効果的となるのはどこかを特定します。
610 <para>Offline gcda and gcno profile dump tool</para>
613 オフラインの gcda および gcno プロファイルダンプツール。
618 <para>Offline gcda profile processing tool</para>
621 オフラインの gcda プロファイル処理ツール。
626 <para>Tool for dumping object files produced by GCC with LTO
630 LTO が有効にした GCC によって生成されるオブジェクトファイルをダンプするためのツール。
635 <para>The Address Sanitizer runtime library</para>
638 アドレスサニタイザー (Address Sanitizer) のランタイムライブラリ。
643 <para>GCC atomic built-in runtime library</para>
646 GCC 不可分 (アトミック) ビルトインランタイムライブラリ。
651 <para>The C preprocessing library</para>
659 <para>Contains run-time support for <command>gcc</command></para>
662 <command>gcc</command> のランタイムサポートを提供します。
667 <para>This library is linked in to a program when GCC is instructed
668 to enable profiling</para>
671 GCC のプロファイリングを有効にした場合にこのライブラリがリンクされます。
676 <para>GNU implementation of the OpenMP API for multi-platform
677 shared-memory parallel programming in C/C++ and Fortran</para>
680 C/C++ や Fortran においてマルチプラットフォームでの共有メモリ並行プログラミング
681 (multi-platform shared-memory parallel programming)
682 を行うための GNU による OpenMP API インプリメンテーションです。
687 <para>The GNU transactional memory library</para>
690 GNU のトランザクショナル(transactional)メモリーライブラリ。
695 <para>The Leak Sanitizer runtime library</para>
698 リークサニタイザー (Leak Sanitizer) のランタイムライブラリ。
703 <para>GCC's LTO plugin allows binutils to process object files
704 produced by GCC with LTO enabled</para>
707 GCC の LTO プラグインは、LTO を有効にした GCC から生成されたオブジェクトファイルを binnutils が処理できるようにします。
712 <para>GCC Quad Precision Math Library API</para>
715 GCC の4倍精度数値演算 (Quad Precision Math) ライブラリ API
720 <para>Contains routines supporting GCC's stack-smashing protection
724 GCC のスタック破壊を防止する (stack-smashing protection) 機能をサポートするルーチンを提供します。
729 <para>The standard C++ library</para>
731 <para>標準 C++ ライブラリ</para>
735 <para>ISO/IEC TS 18822:2015 Filesystem library</para>
738 ISO/IEC TS 18822:2015 ファイルシステムライブラリ。
743 <para>Provides supporting routines for the C++ programming
747 C++ プログラミング言語のためのサポートルーチンを提供します。
752 <para>The Thread Sanitizer runtime library</para>
755 スレッドサニタイザー (Thread Sanitizer) のランタイムライブラリ。
760 <para>The Undefined Behavior Sanitizer runtime library</para>
763 Undefined Behavior Sanitizer ランタイムライブラリ。