adjusting.po 11 KB

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