toolchaintechnotes.po 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507
  1. # SOME DESCRIPTIVE TITLE
  2. # Copyright (C) YEAR Free Software Foundation, Inc.
  3. # This file is distributed under the same license as the PACKAGE package.
  4. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
  5. #
  6. #, fuzzy
  7. msgid ""
  8. msgstr ""
  9. "Project-Id-Version: PACKAGE VERSION\n"
  10. "POT-Creation-Date: 2020-06-18 09:37+0800\n"
  11. "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  12. "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  13. "Language-Team: LANGUAGE <LL@li.org>\n"
  14. "Language: \n"
  15. "MIME-Version: 1.0\n"
  16. "Content-Type: text/plain; charset=UTF-8\n"
  17. "Content-Transfer-Encoding: 8bit\n"
  18. #. type: Content of: <sect1><title>
  19. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:11
  20. msgid "Toolchain Technical Notes"
  21. msgstr ""
  22. #. type: Content of: <sect1><para>
  23. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:13
  24. msgid ""
  25. "This section explains some of the rationale and technical details behind the "
  26. "overall build method. It is not essential to immediately understand "
  27. "everything in this section. Most of this information will be clearer after "
  28. "performing an actual build. This section can be referred to at any time "
  29. "during the process."
  30. msgstr ""
  31. #. type: Content of: <sect1><para>
  32. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:19
  33. msgid ""
  34. "The overall goal of this chapter and <xref "
  35. "linkend=\"chapter-temporary-tools\"/> is to produce a temporary area that "
  36. "contains a known-good set of tools that can be isolated from the host "
  37. "system. By using <command>chroot</command>, the commands in the remaining "
  38. "chapters will be contained within that environment, ensuring a clean, "
  39. "trouble-free build of the target LFS system. The build process has been "
  40. "designed to minimize the risks for new readers and to provide the most "
  41. "educational value at the same time."
  42. msgstr ""
  43. #. type: Content of: <sect1><para>
  44. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:28
  45. msgid ""
  46. "The build process is based on the process of "
  47. "<emphasis>cross-compilation</emphasis>. Cross-compilation is normally used "
  48. "for building a compiler and its toolchain for a machine different from the "
  49. "one that is used for the build. This is not strictly needed for LFS, since "
  50. "the machine where the new system will run is the same as the one used for "
  51. "the build. But cross-compilation has the great advantage that anything that "
  52. "is cross-compiled cannot depend on the host environment."
  53. msgstr ""
  54. #. type: Content of: <sect1><sect2><title>
  55. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:38
  56. msgid "About Cross-Compilation"
  57. msgstr ""
  58. #. type: Content of: <sect1><sect2><para>
  59. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:40
  60. msgid ""
  61. "Cross-compilation involves some concepts that deserve a section on their "
  62. "own. Although this section may be omitted in a first reading, it is strongly "
  63. "suggested to come back to it later in order to get a full grasp of the build "
  64. "process."
  65. msgstr ""
  66. #. type: Content of: <sect1><sect2><para>
  67. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:45
  68. msgid "Let us first define some terms used in this context:"
  69. msgstr ""
  70. #. type: Content of: <sect1><sect2><variablelist><varlistentry><term>
  71. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:48
  72. msgid "build"
  73. msgstr ""
  74. #. type: Content of: <sect1><sect2><variablelist><varlistentry><listitem><para>
  75. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:49
  76. msgid ""
  77. "is the machine where we build programs. Note that this machine is referred "
  78. "to as the <quote>host</quote> in other sections."
  79. msgstr ""
  80. #. type: Content of: <sect1><sect2><variablelist><varlistentry><term>
  81. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:54
  82. msgid "host"
  83. msgstr ""
  84. #. type: Content of: <sect1><sect2><variablelist><varlistentry><listitem><para>
  85. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:55
  86. msgid ""
  87. "is the machine/system where the built programs will run. Note that this use "
  88. "of <quote>host</quote> is not the same as in other sections."
  89. msgstr ""
  90. #. type: Content of: <sect1><sect2><variablelist><varlistentry><term>
  91. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:60
  92. msgid "target"
  93. msgstr ""
  94. #. type: Content of: <sect1><sect2><variablelist><varlistentry><listitem><para>
  95. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:61
  96. msgid ""
  97. "is only used for compilers. It is the machine the compiler produces code "
  98. "for. It may be different from both build and host."
  99. msgstr ""
  100. #. type: Content of: <sect1><sect2><para>
  101. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:68
  102. msgid ""
  103. "As an example, let us imagine the following scenario: we may have a compiler "
  104. "on a slow machine only, let's call the machine A, and the compiler ccA. We "
  105. "may have also a fast machine (B), but with no compiler, and we may want to "
  106. "produce code for a another slow machine (C). Then, to build a compiler for "
  107. "machine C, we would have three stages:"
  108. msgstr ""
  109. #. type: Content of: <sect1><sect2><informaltable><tgroup><thead><row><entry>
  110. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:82
  111. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:116
  112. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:186
  113. msgid "Stage"
  114. msgstr ""
  115. #. type: Content of: <sect1><sect2><informaltable><tgroup><thead><row><entry>
  116. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:82
  117. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:116
  118. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:186
  119. msgid "Build"
  120. msgstr ""
  121. #. type: Content of: <sect1><sect2><informaltable><tgroup><thead><row><entry>
  122. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:82
  123. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:116
  124. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:186
  125. msgid "Host"
  126. msgstr ""
  127. #. type: Content of: <sect1><sect2><informaltable><tgroup><thead><row><entry>
  128. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:83
  129. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:117
  130. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:187
  131. msgid "Target"
  132. msgstr ""
  133. #. type: Content of: <sect1><sect2><informaltable><tgroup><thead><row><entry>
  134. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:83
  135. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:117
  136. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:187
  137. msgid "Action"
  138. msgstr ""
  139. #. type: Content of: <sect1><sect2><informaltable><tgroup><tbody><row><entry>
  140. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:87
  141. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:191
  142. msgid "1"
  143. msgstr ""
  144. #. type: Content of: <sect1><sect2><informaltable><tgroup><tbody><row><entry>
  145. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:87
  146. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:91
  147. msgid "A"
  148. msgstr ""
  149. #. type: Content of: <sect1><sect2><informaltable><tgroup><tbody><row><entry>
  150. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:87
  151. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:91
  152. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:95
  153. msgid "B"
  154. msgstr ""
  155. #. type: Content of: <sect1><sect2><informaltable><tgroup><tbody><row><entry>
  156. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:88
  157. msgid "build cross-compiler cc1 using ccA on machine A"
  158. msgstr ""
  159. #. type: Content of: <sect1><sect2><informaltable><tgroup><tbody><row><entry>
  160. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:91
  161. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:195
  162. msgid "2"
  163. msgstr ""
  164. #. type: Content of: <sect1><sect2><informaltable><tgroup><tbody><row><entry>
  165. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:92
  166. msgid "build cross-compiler cc2 using cc1 on machine A"
  167. msgstr ""
  168. #. type: Content of: <sect1><sect2><informaltable><tgroup><tbody><row><entry>
  169. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:95
  170. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:199
  171. msgid "3"
  172. msgstr ""
  173. #. type: Content of: <sect1><sect2><informaltable><tgroup><tbody><row><entry>
  174. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:95
  175. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:121
  176. msgid "C"
  177. msgstr ""
  178. #. type: Content of: <sect1><sect2><informaltable><tgroup><tbody><row><entry>
  179. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:96
  180. msgid "build compiler ccC using cc2 on machine B"
  181. msgstr ""
  182. #. type: Content of: <sect1><sect2><para>
  183. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:102
  184. msgid ""
  185. "Then, all the other programs needed by machine C can be compiled using cc2 "
  186. "on the fast machine B. Note that unless B can run programs produced for C, "
  187. "there is no way to test the built programs until machine C itself is "
  188. "running. For example, for testing ccC, we may want to add a fourth stage:"
  189. msgstr ""
  190. #. type: Content of: <sect1><sect2><informaltable><tgroup><tbody><row><entry>
  191. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:121
  192. msgid "4"
  193. msgstr ""
  194. #. type: Content of: <sect1><sect2><informaltable><tgroup><tbody><row><entry>
  195. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:122
  196. msgid "rebuild and test ccC using itself on machine C"
  197. msgstr ""
  198. #. type: Content of: <sect1><sect2><para>
  199. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:128
  200. msgid ""
  201. "In the example above, only cc1 and cc2 are cross-compilers, that is, they "
  202. "produce code for a machine different from the one they are run on. The "
  203. "other compilers ccA and ccC produce code for the machine they are run "
  204. "on. Such compilers are called <emphasis>native</emphasis> compilers."
  205. msgstr ""
  206. #. type: Content of: <sect1><sect2><title>
  207. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:136
  208. msgid "Implementation of Cross-Compilation for LFS"
  209. msgstr ""
  210. #. type: Content of: <sect1><sect2><note><para>
  211. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:139
  212. msgid ""
  213. "Almost all the build systems use names of the form cpu-vendor-kernel-os "
  214. "referred to as the machine triplet. An astute reader may wonder why a "
  215. "<quote>triplet</quote> refers to a four component name. The reason is "
  216. "history: initially, three component names were enough to designate "
  217. "unambiguously a machine, but with new machines and systems appearing, that "
  218. "proved insufficient. The word <quote>triplet</quote> remained. A simple way "
  219. "to determine your machine triplet is to run the "
  220. "<command>config.guess</command> script that comes with the source for many "
  221. "packages. Unpack the binutils sources and run the script: "
  222. "<userinput>./config.guess</userinput> and note the output. For example, for "
  223. "a 32-bit Intel processor the output will be "
  224. "<emphasis>i686-pc-linux-gnu</emphasis>. On a 64-bit system it will be "
  225. "<emphasis>x86_64-pc-linux-gnu</emphasis>."
  226. msgstr ""
  227. #. type: Content of: <sect1><sect2><note><para>
  228. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:153
  229. msgid ""
  230. "Also be aware of the name of the platform's dynamic linker, often referred "
  231. "to as the dynamic loader (not to be confused with the standard linker "
  232. "<command>ld</command> that is part of binutils). The dynamic linker provided "
  233. "by Glibc finds and loads the shared libraries needed by a program, prepares "
  234. "the program to run, and then runs it. The name of the dynamic linker for a "
  235. "32-bit Intel machine will be <filename "
  236. "class=\"libraryfile\">ld-linux.so.2</filename> (<filename "
  237. "class=\"libraryfile\">ld-linux-x86-64.so.2</filename> for 64-bit systems). A "
  238. "sure-fire way to determine the name of the dynamic linker is to inspect a "
  239. "random binary from the host system by running: <userinput>readelf -l "
  240. "&lt;name of binary&gt; | grep interpreter</userinput> and noting the "
  241. "output. The authoritative reference covering all platforms is in the "
  242. "<filename>shlib-versions</filename> file in the root of the Glibc source "
  243. "tree."
  244. msgstr ""
  245. #. type: Content of: <sect1><sect2><para>
  246. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:169
  247. msgid ""
  248. "In order to fake a cross compilation, the name of the host triplet is "
  249. "slightly adjusted by changing the &quot;vendor&quot; field in the "
  250. "<envar>LFS_TGT</envar> variable. We also use the "
  251. "<parameter>--with-sysroot</parameter> option when building the cross linker "
  252. "and cross compiler to tell them where to find the needed host files. This "
  253. "ensures that none of the other programs built in <xref "
  254. "linkend=\"chapter-temporary-tools\"/> can link to libraries on the build "
  255. "machine. Only two stages are mandatory, and one more for tests:"
  256. msgstr ""
  257. #. type: Content of: <sect1><sect2><informaltable><tgroup><tbody><row><entry>
  258. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:191
  259. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:195
  260. msgid "pc"
  261. msgstr ""
  262. #. type: Content of: <sect1><sect2><informaltable><tgroup><tbody><row><entry>
  263. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:191
  264. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:195
  265. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:199
  266. msgid "lfs"
  267. msgstr ""
  268. #. type: Content of: <sect1><sect2><informaltable><tgroup><tbody><row><entry>
  269. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:192
  270. msgid "build cross-compiler cc1 using cc-pc on pc"
  271. msgstr ""
  272. #. type: Content of: <sect1><sect2><informaltable><tgroup><tbody><row><entry>
  273. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:196
  274. msgid "build compiler cc-lfs using cc1 on pc"
  275. msgstr ""
  276. #. type: Content of: <sect1><sect2><informaltable><tgroup><tbody><row><entry>
  277. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:200
  278. msgid "rebuild and test cc-lfs using itself on lfs"
  279. msgstr ""
  280. #. type: Content of: <sect1><sect2><para>
  281. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:206
  282. msgid ""
  283. "In the above table, <quote>on pc</quote> means the commands are run on a "
  284. "machine using the already installed distribution. <quote>On lfs</quote> "
  285. "means the commands are run in a chrooted environment."
  286. msgstr ""
  287. #. type: Content of: <sect1><sect2><para>
  288. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:210
  289. msgid ""
  290. "Now, there is more about cross-compiling: the C language is not just a "
  291. "compiler, but also defines a standard library. In this book, the GNU C "
  292. "library, named glibc, is used. This library must be compiled for the lfs "
  293. "machine, that is, using the cross compiler cc1. But the compiler itself "
  294. "uses an internal library implementing complex instructions not available in "
  295. "the assembler instruction set. This internal library is named libgcc, and "
  296. "must be linked to the glibc library to be fully functional! Furthermore, the "
  297. "standard library for C++ (libstdc++) also needs being linked to glibc. The "
  298. "solution to this chicken and egg problem is to first build a degraded cc1 "
  299. "based libgcc, lacking some fuctionalities such as threads and exception "
  300. "handling, then build glibc using this degraded compiler (glibc itself is not "
  301. "degraded), then build libstdc++. But this last library will lack the same "
  302. "functionalities as libgcc."
  303. msgstr ""
  304. #. type: Content of: <sect1><sect2><para>
  305. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:225
  306. msgid ""
  307. "This is not the end of the story: the conclusion of the preceding paragraph "
  308. "is that cc1 is unable to build a fully functional libstdc++, but this is the "
  309. "only compiler available for building the C/C++ libraries during stage 2! Of "
  310. "course, the compiler built during stage 2, cc-lfs, would be able to build "
  311. "those libraries, but (1) the build system of GCC does not know that it is "
  312. "usable on pc, and (2) using it on pc would be at risk of linking to the pc "
  313. "libraries, since cc-lfs is a native compiler. So we have to build libstdc++ "
  314. "later, in chroot."
  315. msgstr ""
  316. #. type: Content of: <sect1><sect2><title>
  317. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:238
  318. msgid "Other procedural details"
  319. msgstr ""
  320. #. type: Content of: <sect1><sect2><para>
  321. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:240
  322. msgid ""
  323. "The cross-compiler will be installed in a separate <filename "
  324. "class=\"directory\">$LFS/tools</filename> directory, since it will not be "
  325. "part of the final system."
  326. msgstr ""
  327. #. type: Content of: <sect1><sect2><para>
  328. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:244
  329. msgid ""
  330. "Binutils is installed first because the <command>configure</command> runs of "
  331. "both GCC and Glibc perform various feature tests on the assembler and linker "
  332. "to determine which software features to enable or disable. This is more "
  333. "important than one might first realize. An incorrectly configured GCC or "
  334. "Glibc can result in a subtly broken toolchain, where the impact of such "
  335. "breakage might not show up until near the end of the build of an entire "
  336. "distribution. A test suite failure will usually highlight this error before "
  337. "too much additional work is performed."
  338. msgstr ""
  339. #. type: Content of: <sect1><sect2><para>
  340. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:253
  341. msgid ""
  342. "Binutils installs its assembler and linker in two locations, <filename "
  343. "class=\"directory\">$LFS/tools/bin</filename> and <filename "
  344. "class=\"directory\">$LFS/tools/$LFS_TGT/bin</filename>. The tools in one "
  345. "location are hard linked to the other. An important facet of the linker is "
  346. "its library search order. Detailed information can be obtained from "
  347. "<command>ld</command> by passing it the <parameter>--verbose</parameter> "
  348. "flag. For example, <command>$LFS_TGT-ld --verbose | grep SEARCH</command> "
  349. "will illustrate the current search paths and their order. It shows which "
  350. "files are linked by <command>ld</command> by compiling a dummy program and "
  351. "passing the <parameter>--verbose</parameter> switch to the linker. For "
  352. "example, <command>$LFS_TGT-gcc dummy.c -Wl,--verbose 2&gt;&amp;1 | grep "
  353. "succeeded</command> will show all the files successfully opened during the "
  354. "linking."
  355. msgstr ""
  356. #. type: Content of: <sect1><sect2><para>
  357. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:267
  358. msgid ""
  359. "The next package installed is GCC. An example of what can be seen during its "
  360. "run of <command>configure</command> is:"
  361. msgstr ""
  362. #. type: Content of: <sect1><sect2><screen>
  363. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:270
  364. #, no-wrap
  365. msgid ""
  366. "<computeroutput>checking what assembler to "
  367. "use... /mnt/lfs/tools/i686-lfs-linux-gnu/bin/as\n"
  368. "checking what linker to "
  369. "use... /mnt/lfs/tools/i686-lfs-linux-gnu/bin/ld</computeroutput>"
  370. msgstr ""
  371. #. type: Content of: <sect1><sect2><para>
  372. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:273
  373. msgid ""
  374. "This is important for the reasons mentioned above. It also demonstrates that "
  375. "GCC's configure script does not search the PATH directories to find which "
  376. "tools to use. However, during the actual operation of <command>gcc</command> "
  377. "itself, the same search paths are not necessarily used. To find out which "
  378. "standard linker <command>gcc</command> will use, run: <command>$LFS_TGT-gcc "
  379. "-print-prog-name=ld</command>."
  380. msgstr ""
  381. #. type: Content of: <sect1><sect2><para>
  382. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:280
  383. msgid ""
  384. "Detailed information can be obtained from <command>gcc</command> by passing "
  385. "it the <parameter>-v</parameter> command line option while compiling a dummy "
  386. "program. For example, <command>gcc -v dummy.c</command> will show detailed "
  387. "information about the preprocessor, compilation, and assembly stages, "
  388. "including <command>gcc</command>'s included search paths and their order."
  389. msgstr ""
  390. #. type: Content of: <sect1><sect2><para>
  391. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:287
  392. msgid ""
  393. "Next installed are sanitized Linux API headers. These allow the standard C "
  394. "library (Glibc) to interface with features that the Linux kernel will "
  395. "provide."
  396. msgstr ""
  397. #. type: Content of: <sect1><sect2><para>
  398. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:291
  399. msgid ""
  400. "The next package installed is Glibc. The most important considerations for "
  401. "building Glibc are the compiler, binary tools, and kernel headers. The "
  402. "compiler is generally not an issue since Glibc will always use the compiler "
  403. "relating to the <parameter>--host</parameter> parameter passed to its "
  404. "configure script; e.g. in our case, the compiler will be "
  405. "<command>$LFS_TGT-gcc</command>. The binary tools and kernel headers can be "
  406. "a bit more complicated. Therefore, take no risks and use the available "
  407. "configure switches to enforce the correct selections. After the run of "
  408. "<command>configure</command>, check the contents of the "
  409. "<filename>config.make</filename> file in the <filename "
  410. "class=\"directory\">build</filename> directory for all important details. "
  411. "Note the use of <parameter>CC=\"$LFS_TGT-gcc\"</parameter> (with "
  412. "<envar>$LFS_TGT</envar> expanded) to control which binary tools are used and "
  413. "the use of the <parameter>-nostdinc</parameter> and "
  414. "<parameter>-isystem</parameter> flags to control the compiler's include "
  415. "search path. These items highlight an important aspect of the Glibc "
  416. "package&mdash;it is very self-sufficient in terms of its build machinery and "
  417. "generally does not rely on toolchain defaults."
  418. msgstr ""
  419. #. type: Content of: <sect1><sect2><para>
  420. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:310
  421. msgid ""
  422. "As said above, the standard C++ library is compiled next, followed in "
  423. "Chapter 6 by all the programs that need themselves to be built. The install "
  424. "step of libstdc++ uses the <envar>DESTDIR</envar> variable to have the "
  425. "programs land into the LFS filesystem."
  426. msgstr ""
  427. #. type: Content of: <sect1><sect2><para>
  428. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:315
  429. msgid ""
  430. "In Chapter 7 the native lfs compiler is built. First binutils-pass2, with "
  431. "the same <envar>DESTDIR</envar> install as the other programs is built, and "
  432. "then the second pass of GCC is constructed, omitting libstdc++ and other "
  433. "non-important libraries. Due to some weird logic in GCC's configure script, "
  434. "<envar>CC_FOR_TARGET</envar> ends up as <command>cc</command> when the host "
  435. "is the same as the target, but is different from the build system. This is "
  436. "why <parameter>CC_FOR_TARGET=$LFS_TGT-gcc</parameter> is put explicitely "
  437. "into the configure options."
  438. msgstr ""
  439. #. type: Content of: <sect1><sect2><para>
  440. #: /home/xry111/svn-repos/LFS-BOOK/part3intro/toolchaintechnotes.xml:325
  441. msgid ""
  442. "Upon entering the chroot environment in <xref "
  443. "linkend=\"chapter-chroot-temporary-tools\"/>, the first task is to install "
  444. "libstdc++. Then temporary installations of programs needed for the proper "
  445. "operation of the toolchain are performed. Programs needed for testing other "
  446. "programs are also built. From this point onwards, the core toolchain is "
  447. "self-contained and self-hosted. In <xref "
  448. "linkend=\"chapter-building-system\"/>, final versions of all the packages "
  449. "needed for a fully functional system are built, tested and installed."
  450. msgstr ""