Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

144 lines
6.8KB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1988-2020 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation; with the
  7. Invariant Sections being "Funding Free Software", the Front-Cover
  8. Texts being (a) (see below), and with the Back-Cover Texts being (b)
  9. (see below). A copy of the license is included in the section entitled
  10. "GNU Free Documentation License".
  11. (a) The FSF's Front-Cover Text is:
  12. A GNU Manual
  13. (b) The FSF's Back-Cover Text is:
  14. You have freedom to copy and modify this GNU Manual, like GNU
  15. software. Copies published by the Free Software Foundation raise
  16. funds for GNU development. -->
  17. <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
  18. <head>
  19. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  20. <title>Configure Terms (GNU Compiler Collection (GCC) Internals)</title>
  21. <meta name="description" content="Configure Terms (GNU Compiler Collection (GCC) Internals)">
  22. <meta name="keywords" content="Configure Terms (GNU Compiler Collection (GCC) Internals)">
  23. <meta name="resource-type" content="document">
  24. <meta name="distribution" content="global">
  25. <meta name="Generator" content="makeinfo">
  26. <link href="index.html#Top" rel="start" title="Top">
  27. <link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
  28. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  29. <link href="Source-Tree.html#Source-Tree" rel="up" title="Source Tree">
  30. <link href="Top-Level.html#Top-Level" rel="next" title="Top Level">
  31. <link href="Source-Tree.html#Source-Tree" rel="prev" title="Source Tree">
  32. <style type="text/css">
  33. <!--
  34. a.summary-letter {text-decoration: none}
  35. blockquote.indentedblock {margin-right: 0em}
  36. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  37. blockquote.smallquotation {font-size: smaller}
  38. div.display {margin-left: 3.2em}
  39. div.example {margin-left: 3.2em}
  40. div.lisp {margin-left: 3.2em}
  41. div.smalldisplay {margin-left: 3.2em}
  42. div.smallexample {margin-left: 3.2em}
  43. div.smalllisp {margin-left: 3.2em}
  44. kbd {font-style: oblique}
  45. pre.display {font-family: inherit}
  46. pre.format {font-family: inherit}
  47. pre.menu-comment {font-family: serif}
  48. pre.menu-preformatted {font-family: serif}
  49. pre.smalldisplay {font-family: inherit; font-size: smaller}
  50. pre.smallexample {font-size: smaller}
  51. pre.smallformat {font-family: inherit; font-size: smaller}
  52. pre.smalllisp {font-size: smaller}
  53. span.nolinebreak {white-space: nowrap}
  54. span.roman {font-family: initial; font-weight: normal}
  55. span.sansserif {font-family: sans-serif; font-weight: normal}
  56. ul.no-bullet {list-style: none}
  57. -->
  58. </style>
  59. </head>
  60. <body lang="en">
  61. <a name="Configure-Terms"></a>
  62. <div class="header">
  63. <p>
  64. Next: <a href="Top-Level.html#Top-Level" accesskey="n" rel="next">Top Level</a>, Up: <a href="Source-Tree.html#Source-Tree" accesskey="u" rel="up">Source Tree</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  65. </div>
  66. <hr>
  67. <a name="Configure-Terms-and-History"></a>
  68. <h3 class="section">6.1 Configure Terms and History</h3>
  69. <a name="index-configure-terms"></a>
  70. <a name="index-canadian"></a>
  71. <p>The configure and build process has a long and colorful history, and can
  72. be confusing to anyone who doesn&rsquo;t know why things are the way they are.
  73. While there are other documents which describe the configuration process
  74. in detail, here are a few things that everyone working on GCC should
  75. know.
  76. </p>
  77. <p>There are three system names that the build knows about: the machine you
  78. are building on (<em>build</em>), the machine that you are building for
  79. (<em>host</em>), and the machine that GCC will produce code for
  80. (<em>target</em>). When you configure GCC, you specify these with
  81. <samp>--build=</samp>, <samp>--host=</samp>, and <samp>--target=</samp>.
  82. </p>
  83. <p>Specifying the host without specifying the build should be avoided, as
  84. <code>configure</code> may (and once did) assume that the host you specify
  85. is also the build, which may not be true.
  86. </p>
  87. <p>If build, host, and target are all the same, this is called a
  88. <em>native</em>. If build and host are the same but target is different,
  89. this is called a <em>cross</em>. If build, host, and target are all
  90. different this is called a <em>canadian</em> (for obscure reasons dealing
  91. with Canada&rsquo;s political party and the background of the person working
  92. on the build at that time). If host and target are the same, but build
  93. is different, you are using a cross-compiler to build a native for a
  94. different system. Some people call this a <em>host-x-host</em>,
  95. <em>crossed native</em>, or <em>cross-built native</em>. If build and target
  96. are the same, but host is different, you are using a cross compiler to
  97. build a cross compiler that produces code for the machine you&rsquo;re
  98. building on. This is rare, so there is no common way of describing it.
  99. There is a proposal to call this a <em>crossback</em>.
  100. </p>
  101. <p>If build and host are the same, the GCC you are building will also be
  102. used to build the target libraries (like <code>libstdc++</code>). If build and host
  103. are different, you must have already built and installed a cross
  104. compiler that will be used to build the target libraries (if you
  105. configured with <samp>--target=foo-bar</samp>, this compiler will be called
  106. <code>foo-bar-gcc</code>).
  107. </p>
  108. <p>In the case of target libraries, the machine you&rsquo;re building for is the
  109. machine you specified with <samp>--target</samp>. So, build is the machine
  110. you&rsquo;re building on (no change there), host is the machine you&rsquo;re
  111. building for (the target libraries are built for the target, so host is
  112. the target you specified), and target doesn&rsquo;t apply (because you&rsquo;re not
  113. building a compiler, you&rsquo;re building libraries). The configure/make
  114. process will adjust these variables as needed. It also sets
  115. <code>$with_cross_host</code> to the original <samp>--host</samp> value in case you
  116. need it.
  117. </p>
  118. <p>The <code>libiberty</code> support library is built up to three times: once
  119. for the host, once for the target (even if they are the same), and once
  120. for the build if build and host are different. This allows it to be
  121. used by all programs which are generated in the course of the build
  122. process.
  123. </p>
  124. <hr>
  125. <div class="header">
  126. <p>
  127. Next: <a href="Top-Level.html#Top-Level" accesskey="n" rel="next">Top Level</a>, Up: <a href="Source-Tree.html#Source-Tree" accesskey="u" rel="up">Source Tree</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  128. </div>
  129. </body>
  130. </html>