Configure-Terms.html 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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-2017 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 5.2, http://www.gnu.org/software/texinfo/ -->
  18. <head>
  19. <title>GNU Compiler Collection (GCC) Internals: Configure Terms</title>
  20. <meta name="description" content="GNU Compiler Collection (GCC) Internals: Configure Terms">
  21. <meta name="keywords" content="GNU Compiler Collection (GCC) Internals: Configure Terms">
  22. <meta name="resource-type" content="document">
  23. <meta name="distribution" content="global">
  24. <meta name="Generator" content="makeinfo">
  25. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  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.smallquotation {font-size: smaller}
  36. div.display {margin-left: 3.2em}
  37. div.example {margin-left: 3.2em}
  38. div.indentedblock {margin-left: 3.2em}
  39. div.lisp {margin-left: 3.2em}
  40. div.smalldisplay {margin-left: 3.2em}
  41. div.smallexample {margin-left: 3.2em}
  42. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  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.nocodebreak {white-space:nowrap}
  54. span.nolinebreak {white-space:nowrap}
  55. span.roman {font-family:serif; font-weight:normal}
  56. span.sansserif {font-family:sans-serif; font-weight:normal}
  57. ul.no-bullet {list-style: none}
  58. -->
  59. </style>
  60. </head>
  61. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  62. <a name="Configure-Terms"></a>
  63. <div class="header">
  64. <p>
  65. 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>
  66. </div>
  67. <hr>
  68. <a name="Configure-Terms-and-History"></a>
  69. <h3 class="section">6.1 Configure Terms and History</h3>
  70. <a name="index-configure-terms"></a>
  71. <a name="index-canadian"></a>
  72. <p>The configure and build process has a long and colorful history, and can
  73. be confusing to anyone who doesn&rsquo;t know why things are the way they are.
  74. While there are other documents which describe the configuration process
  75. in detail, here are a few things that everyone working on GCC should
  76. know.
  77. </p>
  78. <p>There are three system names that the build knows about: the machine you
  79. are building on (<em>build</em>), the machine that you are building for
  80. (<em>host</em>), and the machine that GCC will produce code for
  81. (<em>target</em>). When you configure GCC, you specify these with
  82. <samp>--build=</samp>, <samp>--host=</samp>, and <samp>--target=</samp>.
  83. </p>
  84. <p>Specifying the host without specifying the build should be avoided, as
  85. <code>configure</code> may (and once did) assume that the host you specify
  86. is also the build, which may not be true.
  87. </p>
  88. <p>If build, host, and target are all the same, this is called a
  89. <em>native</em>. If build and host are the same but target is different,
  90. this is called a <em>cross</em>. If build, host, and target are all
  91. different this is called a <em>canadian</em> (for obscure reasons dealing
  92. with Canada&rsquo;s political party and the background of the person working
  93. on the build at that time). If host and target are the same, but build
  94. is different, you are using a cross-compiler to build a native for a
  95. different system. Some people call this a <em>host-x-host</em>,
  96. <em>crossed native</em>, or <em>cross-built native</em>. If build and target
  97. are the same, but host is different, you are using a cross compiler to
  98. build a cross compiler that produces code for the machine you&rsquo;re
  99. building on. This is rare, so there is no common way of describing it.
  100. There is a proposal to call this a <em>crossback</em>.
  101. </p>
  102. <p>If build and host are the same, the GCC you are building will also be
  103. used to build the target libraries (like <code>libstdc++</code>). If build and host
  104. are different, you must have already built and installed a cross
  105. compiler that will be used to build the target libraries (if you
  106. configured with <samp>--target=foo-bar</samp>, this compiler will be called
  107. <code>foo-bar-gcc</code>).
  108. </p>
  109. <p>In the case of target libraries, the machine you&rsquo;re building for is the
  110. machine you specified with <samp>--target</samp>. So, build is the machine
  111. you&rsquo;re building on (no change there), host is the machine you&rsquo;re
  112. building for (the target libraries are built for the target, so host is
  113. the target you specified), and target doesn&rsquo;t apply (because you&rsquo;re not
  114. building a compiler, you&rsquo;re building libraries). The configure/make
  115. process will adjust these variables as needed. It also sets
  116. <code>$with_cross_host</code> to the original <samp>--host</samp> value in case you
  117. need it.
  118. </p>
  119. <p>The <code>libiberty</code> support library is built up to three times: once
  120. for the host, once for the target (even if they are the same), and once
  121. for the build if build and host are different. This allows it to be
  122. used by all programs which are generated in the course of the build
  123. process.
  124. </p>
  125. <hr>
  126. <div class="header">
  127. <p>
  128. 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>
  129. </div>
  130. </body>
  131. </html>