adjusting.po 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. msgid ""
  2. msgstr ""
  3. "X-Pootle-Revision: 9999999\n"
  4. "X-Pootle-Path: /zh_CN/lfs/chapter08/adjusting.po\n"
  5. "Project-Id-Version: PACKAGE VERSION\n"
  6. "POT-Creation-Date: 2020-08-08 19:28+0800\n"
  7. "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  8. "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  9. "Language-Team: LANGUAGE <LL@li.org>\n"
  10. "Language: zh_CN\n"
  11. "MIME-Version: 1.0\n"
  12. "Content-Type: text/plain; charset=UTF-8\n"
  13. "Content-Transfer-Encoding: 8bit\n"
  14. "X-Generator: Translate Toolkit 2.2.5\n"
  15. #. type: Content of: <sect1><title>
  16. msgid "Adjusting the Toolchain"
  17. msgstr "调整工具链"
  18. #. type: Content of: <sect1><para>
  19. msgid ""
  20. "Now that the final C libraries have been installed, it is time to adjust the "
  21. "toolchain so that it will link any newly compiled program against these new "
  22. "libraries."
  23. msgstr ""
  24. "现在最终的 C 运行库已经安装好了,这时就要调整工具链,以便将新编译的任何程序都"
  25. "链接到新的 C 运行库。"
  26. #. type: Content of: <sect1><para>
  27. msgid ""
  28. "First, backup the <filename class=\"directory\">/tools</filename> linker, "
  29. "and replace it with the adjusted linker we made in chapter 5. We'll also "
  30. "create a link to its counterpart in <filename class=\"directory\">/tools/"
  31. "$(uname -m)-pc-linux-gnu/bin</filename>:"
  32. msgstr ""
  33. "首先,备份 <filename class=\"directory\">/tools</filename> 中的链接器,把它替"
  34. "换成第 5 章准备的调整好的链接器。我们也会把 <filename class=\"directory\">/"
  35. "tools/$(uname -m)-pc-linux-gnu/bin</filename> 中对应的链接器替换成一个符号链"
  36. "接:"
  37. #. type: Content of: <sect1><screen>
  38. #, no-wrap
  39. msgid ""
  40. "<userinput>mv -v /tools/bin/{ld,ld-old}\n"
  41. "mv -v /tools/$(uname -m)-pc-linux-gnu/bin/{ld,ld-old}\n"
  42. "mv -v /tools/bin/{ld-new,ld}\n"
  43. "ln -sv /tools/bin/ld /tools/$(uname -m)-pc-linux-gnu/bin/ld</userinput>"
  44. msgstr ""
  45. "<userinput>mv -v /tools/bin/{ld,ld-old}\n"
  46. "mv -v /tools/$(uname -m)-pc-linux-gnu/bin/{ld,ld-old}\n"
  47. "mv -v /tools/bin/{ld-new,ld}\n"
  48. "ln -sv /tools/bin/ld /tools/$(uname -m)-pc-linux-gnu/bin/ld</userinput>"
  49. #. type: Content of: <sect1><para>
  50. msgid ""
  51. "the next command amends the GCC specs file to achieve three goals: first "
  52. "point GCC to the new dynamic linker. Simply deleting all instances of "
  53. "<quote>/tools</quote> should leave us with the correct path to the dynamic "
  54. "linker. Second, let GCC know where to find the Glibc start files. Third, add "
  55. "the /usr/include directory at the end of the default search path, so that "
  56. "header files added in chapter 6 are found. A <command>sed</command> command "
  57. "accomplishes this:"
  58. msgstr ""
  59. "下面修改 GCC 的 specs 文件,使其指向新的动态链接器。把所有的 <quote>/tools</"
  60. "quote> 删除掉就会留下正确的路径。另外,调整 specs 文件,使得 GCC 知道去哪里寻"
  61. "找正确的头文件和 Glibc 启动文件。最后,在默认搜索路径之后加入 /usr/include 目"
  62. "录。一个 <command>sed</command> 命令即可完成以上工作:"
  63. #. type: Content of: <sect1><screen>
  64. #, no-wrap
  65. msgid ""
  66. "<userinput>gcc -dumpspecs | sed -e 's@/tools@@g' \\\n"
  67. " -e '/\\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \\\n"
  68. " -e '/\\*cpp:/{n;s@$@ -idirafter /usr/include@}' &gt; \\\n"
  69. " `dirname $(gcc --print-libgcc-file-name)`/specs</userinput>"
  70. msgstr ""
  71. "<userinput>gcc -dumpspecs | sed -e 's@/tools@@g' \\\n"
  72. " -e '/\\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \\\n"
  73. " -e '/\\*cpp:/{n;s@$@ -idirafter /usr/include@}' &gt; \\\n"
  74. " `dirname $(gcc --print-libgcc-file-name)`/specs</userinput>"
  75. #. type: Content of: <sect1><para>
  76. msgid ""
  77. "It is a good idea to visually inspect the specs file to verify the intended "
  78. "change was actually made."
  79. msgstr "这时最好浏览一下生成的 specs 文件,以确认确实进行了我们期望的修改。"
  80. #. type: Content of: <sect1><para>
  81. msgid ""
  82. "It is imperative at this point to ensure that the basic functions (compiling "
  83. "and linking) of the adjusted toolchain are working as expected. To do this, "
  84. "perform the following sanity checks:"
  85. msgstr ""
  86. "现在的当务之急是保证调整过的工具链的基本功能 (编译和链接) 能够像我们期望的那"
  87. "样工作。为此,进行下列完整性检查:"
  88. #. type: Content of: <sect1><screen>
  89. #, no-wrap
  90. msgid ""
  91. "<userinput>echo 'int main(){}' &gt; dummy.c\n"
  92. "cc dummy.c -v -Wl,--verbose &amp;&gt; dummy.log\n"
  93. "readelf -l a.out | grep ': /lib'</userinput>"
  94. msgstr ""
  95. "<userinput>echo 'int main(){}' &gt; dummy.c\n"
  96. "cc dummy.c -v -Wl,--verbose &amp;&gt; dummy.log\n"
  97. "readelf -l a.out | grep ': /lib'</userinput>"
  98. #. type: Content of: <sect1><para>
  99. msgid ""
  100. "There should be no errors, and the output of the last command will be "
  101. "(allowing for platform-specific differences in the dynamic linker name):"
  102. msgstr ""
  103. "上述命令不应该出现错误,最后一行命令输出的结果应该 (不同平台的动态链接器名称"
  104. "可能不同) 是:"
  105. #. type: Content of: <sect1><screen>
  106. #, no-wrap
  107. msgid "<computeroutput>[Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]</computeroutput>"
  108. msgstr "<computeroutput>[Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]</computeroutput>"
  109. #. type: Content of: <sect1><para>
  110. msgid ""
  111. "Note that on 64-bit systems <filename class=\"directory\">/lib</filename> is "
  112. "the location of our dynamic linker, but is accessed via a symbolic link in /"
  113. "lib64."
  114. msgstr ""
  115. "注意在 64 位系统上 <filename class=\"directory\">/lib</filename> 是动态链接器"
  116. "的位置,但通过 /lib64 中的符号链接访问。"
  117. #. type: Content of: <sect1><note><para>
  118. msgid "On 32-bit systems the interpreter should be /lib/ld-linux.so.2."
  119. msgstr "在 32 位系统上,解释器是 /lib/ld-linux.so.2。"
  120. #. type: Content of: <sect1><para>
  121. msgid "Now make sure that we're setup to use the correct start files:"
  122. msgstr "下面确认我们的设定能够使用正确的启动文件:"
  123. #. type: Content of: <sect1><screen>
  124. #, no-wrap
  125. msgid "<userinput>grep -o '/usr/lib.*/crt[1in].*succeeded' dummy.log</userinput>"
  126. msgstr "<userinput>grep -o '/usr/lib.*/crt[1in].*succeeded' dummy.log</userinput>"
  127. #. type: Content of: <sect1><para>
  128. msgid "The output of the last command should be:"
  129. msgstr "以上命令应该输出:"
  130. #. type: Content of: <sect1><screen>
  131. #, no-wrap
  132. msgid ""
  133. "<computeroutput>/usr/lib/../lib/crt1.o succeeded\n"
  134. "/usr/lib/../lib/crti.o succeeded\n"
  135. "/usr/lib/../lib/crtn.o succeeded</computeroutput>"
  136. msgstr ""
  137. "<computeroutput>/usr/lib/../lib/crt1.o succeeded\n"
  138. "/usr/lib/../lib/crti.o succeeded\n"
  139. "/usr/lib/../lib/crtn.o succeeded</computeroutput>"
  140. #. type: Content of: <sect1><para>
  141. msgid "Verify that the compiler is searching for the correct header files:"
  142. msgstr "确认编译器能正确查找头文件:"
  143. #. type: Content of: <sect1><screen>
  144. #, no-wrap
  145. msgid "<userinput>grep -B4 '^ /usr/include' dummy.log</userinput>"
  146. msgstr "<userinput>grep -B4 '^ /usr/include' dummy.log</userinput>"
  147. #. type: Content of: <sect1><para>
  148. msgid "This command should return the following output:"
  149. msgstr "该命令应当输出:"
  150. #. type: Content of: <sect1><screen>
  151. #, no-wrap
  152. msgid ""
  153. "<computeroutput>#include &lt;...&gt; search starts here:\n"
  154. " /tools/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/include\n"
  155. " /tools/include\n"
  156. " /tools/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/include-fixed\n"
  157. " /usr/include</computeroutput>"
  158. msgstr ""
  159. "<computeroutput>#include &lt;...&gt; search starts here:\n"
  160. " /tools/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/include\n"
  161. " /tools/include\n"
  162. " /tools/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/include-fixed\n"
  163. " /usr/include</computeroutput>"
  164. #. type: Content of: <sect1><note><para>
  165. msgid "On a 32 bit system, x86_64 is replaced with i686."
  166. msgstr "在 32 位系统上,应该将 x86_64 替换成 i686。"
  167. #. type: Content of: <sect1><para>
  168. msgid ""
  169. "Next, verify that the new linker is being used with the correct search paths:"
  170. msgstr "下一步确认新的链接器使用了正确的搜索路径:"
  171. #. type: Content of: <sect1><screen>
  172. #, no-wrap
  173. msgid "<userinput>grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\\n|g'</userinput>"
  174. msgstr "<userinput>grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\\n|g'</userinput>"
  175. #. type: Content of: <sect1><para>
  176. msgid ""
  177. "References to paths that have components with '-linux-gnu' should be "
  178. "ignored, but otherwise the output of the last command should be:"
  179. msgstr "那些包含 '-linux-gnu' 的路径应该忽略,除此之外,以上命令应该输出:"
  180. #. type: Content of: <sect1><screen>
  181. #, no-wrap
  182. msgid ""
  183. "<computeroutput>SEARCH_DIR(\"/usr/lib\")\n"
  184. "SEARCH_DIR(\"/lib\")</computeroutput>"
  185. msgstr ""
  186. "<computeroutput>SEARCH_DIR(\"/usr/lib\")\n"
  187. "SEARCH_DIR(\"/lib\")</computeroutput>"
  188. #. type: Content of: <sect1><para>
  189. msgid "Next make sure that we're using the correct libc:"
  190. msgstr "之后确认我们使用了正确的 libc:"
  191. #. type: Content of: <sect1><screen>
  192. #, no-wrap
  193. msgid "<userinput>grep \"/lib.*/libc.so.6 \" dummy.log</userinput>"
  194. msgstr "<userinput>grep \"/lib.*/libc.so.6 \" dummy.log</userinput>"
  195. #. type: Content of: <sect1><screen>
  196. #, no-wrap
  197. msgid "<computeroutput>attempt to open /lib/libc.so.6 succeeded</computeroutput>"
  198. msgstr "<computeroutput>attempt to open /lib/libc.so.6 succeeded</computeroutput>"
  199. #. type: Content of: <sect1><para>
  200. msgid "Make sure GCC is using the correct dynamic linker:"
  201. msgstr "确认 GCC 使用了正确的动态链接器:"
  202. #. type: Content of: <sect1><screen>
  203. #, no-wrap
  204. msgid "<userinput>grep found dummy.log</userinput>"
  205. msgstr "<userinput>grep found dummy.log</userinput>"
  206. #. type: Content of: <sect1><para>
  207. msgid ""
  208. "The output of the last command should be (allowing for platform-specific "
  209. "differences in dynamic linker name):"
  210. msgstr "以上命令应该输出 (不同平台的动态链接器名称可能不同):"
  211. #. type: Content of: <sect1><screen>
  212. #, no-wrap
  213. msgid "<computeroutput>found ld-linux-x86-64.so.2 at /lib/ld-linux-x86-64.so.2</computeroutput>"
  214. msgstr "<computeroutput>found ld-linux-x86-64.so.2 at /lib/ld-linux-x86-64.so.2</computeroutput>"
  215. #. The most likely
  216. #. reason is that something went wrong with the specs file adjustment.
  217. #. type: Content of: <sect1><para>
  218. msgid ""
  219. "If the output does not appear as shown above or is not received at all, then "
  220. "something is seriously wrong. Investigate and retrace the steps to find out "
  221. "where the problem is and correct it. Any issues will need to be resolved "
  222. "before continuing with the process."
  223. msgstr ""
  224. "如果输出和以上描述不符,或者根本没有输出,那么必然有什么地方出了严重错误。检"
  225. "查并重新跟踪以上步骤,找到问题的原因,并修复它。这里出现的任何问题在继续构建"
  226. "前都必须解决。"
  227. #. type: Content of: <sect1><para>
  228. msgid "Once everything is working correctly, clean up the test files:"
  229. msgstr "在确认一切工作良好后,删除测试文件:"
  230. #. type: Content of: <sect1><screen>
  231. #, no-wrap
  232. msgid "<userinput>rm -v dummy.c a.out dummy.log</userinput>"
  233. msgstr "<userinput>rm -v dummy.c a.out dummy.log</userinput>"