|
@@ -1,4 +1,4 @@
|
|
-<?xml version="1.0" encoding="ISO-8859-1"?>
|
|
|
|
|
|
+<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
|
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
|
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
|
<!ENTITY % general-entities SYSTEM "../general.ent">
|
|
<!ENTITY % general-entities SYSTEM "../general.ent">
|
|
@@ -14,7 +14,7 @@
|
|
<address>&binutils-url;</address>
|
|
<address>&binutils-url;</address>
|
|
</sect1info>
|
|
</sect1info>
|
|
|
|
|
|
- <title>Binutils-&binutils-version; - Pass 1</title>
|
|
|
|
|
|
+ <title>Binutils-&binutils-version; - 第一遍</title>
|
|
|
|
|
|
<indexterm zone="ch-tools-binutils-pass1">
|
|
<indexterm zone="ch-tools-binutils-pass1">
|
|
<primary sortas="a-Binutils">Binutils</primary>
|
|
<primary sortas="a-Binutils">Binutils</primary>
|
|
@@ -41,36 +41,52 @@
|
|
</sect2>
|
|
</sect2>
|
|
|
|
|
|
<sect2 role="installation">
|
|
<sect2 role="installation">
|
|
- <title>Installation of Cross Binutils</title>
|
|
|
|
|
|
+ <title>交叉 Binutils 的安装</title>
|
|
|
|
|
|
- <note><para>Go back and re-read the notes in the previous section.
|
|
|
|
|
|
+ <note><!--para>Go back and re-read the notes in the previous section.
|
|
Understanding the notes labeled important will save you a lot
|
|
Understanding the notes labeled important will save you a lot
|
|
- of problems later.</para></note>
|
|
|
|
|
|
+ of problems later.</para-->
|
|
|
|
+ <para>返回并重新阅读上一节。仔细理解那些标为 <quote>重要</quote>
|
|
|
|
+ 的说明,以防止之后出现问题。</para>
|
|
|
|
+ </note>
|
|
|
|
|
|
- <para>It is important that Binutils be the first package compiled
|
|
|
|
|
|
+ <!--para>It is important that Binutils be the first package compiled
|
|
because both Glibc and GCC perform various tests on the available
|
|
because both Glibc and GCC perform various tests on the available
|
|
linker and assembler to determine which of their own features to
|
|
linker and assembler to determine which of their own features to
|
|
- enable.</para>
|
|
|
|
|
|
+ enable.</para-->
|
|
|
|
+ <para>首先构建 Binutils 相当重要,
|
|
|
|
+ 因为 Glibc 和 GCC 都会对可用的链接器和汇编器进行测试,
|
|
|
|
+ 以决定启用它们的哪些自身特性。</para>
|
|
|
|
|
|
- <para>The Binutils documentation recommends building Binutils
|
|
|
|
- in a dedicated build directory:</para>
|
|
|
|
|
|
+ <!--para>The Binutils documentation recommends building Binutils
|
|
|
|
+ in a dedicated build directory:</para-->
|
|
|
|
+ <para>Binutils 文档推荐在一个专用的目录中构建 Binutils:</para>
|
|
|
|
|
|
<screen><userinput remap="pre">mkdir -v build
|
|
<screen><userinput remap="pre">mkdir -v build
|
|
cd build</userinput></screen>
|
|
cd build</userinput></screen>
|
|
|
|
|
|
<note>
|
|
<note>
|
|
- <para>In order for the SBU values listed in the rest of the book
|
|
|
|
|
|
+ <!--para>In order for the SBU values listed in the rest of the book
|
|
to be of any use, measure the time it takes to build this package from
|
|
to be of any use, measure the time it takes to build this package from
|
|
the configuration, up to and including the first install. To achieve
|
|
the configuration, up to and including the first install. To achieve
|
|
this easily, wrap the commands in a <command>time</command>
|
|
this easily, wrap the commands in a <command>time</command>
|
|
command like this: <userinput>time { ./configure ... && ...
|
|
command like this: <userinput>time { ./configure ... && ...
|
|
- && make install; }</userinput>.</para>
|
|
|
|
|
|
+ && make install; }</userinput>.</para-->
|
|
|
|
+ <para>为了衡量本书其余部分使用的 SBU 值,
|
|
|
|
+ 需要测量本软件包从配置开始直到第一次安装花费的时间。
|
|
|
|
+ 为了容易地完成测量,可以将命令包装在 <command>time</command>
|
|
|
|
+ 命令中,就像这样:
|
|
|
|
+ <userinput>time {./configure ... && ... &&
|
|
|
|
+ make install; }</userinput>。</para>
|
|
</note>
|
|
</note>
|
|
|
|
|
|
- <note><para>The approximate build SBU values and required disk space
|
|
|
|
- in Chapter 5 does not include test suite data.</para></note>
|
|
|
|
|
|
+ <note><!--para>The approximate build SBU values and required disk space
|
|
|
|
+ in Chapter 5 does not include test suite data.</para-->
|
|
|
|
+ <para>第 5 章中估计的 SBU 值和所需磁盘空间都不包含测试套件的数据。
|
|
|
|
+ </para>
|
|
|
|
+ </note>
|
|
|
|
|
|
- <para>Now prepare Binutils for compilation:</para>
|
|
|
|
|
|
+ <para>现在,准备编译 Binutils :</para>
|
|
|
|
|
|
<screen><userinput remap="configure">../configure --prefix=/tools \
|
|
<screen><userinput remap="configure">../configure --prefix=/tools \
|
|
--with-sysroot=$LFS \
|
|
--with-sysroot=$LFS \
|
|
@@ -80,80 +96,79 @@ cd build</userinput></screen>
|
|
--disable-werror</userinput></screen>
|
|
--disable-werror</userinput></screen>
|
|
|
|
|
|
<variablelist>
|
|
<variablelist>
|
|
- <title>The meaning of the configure options:</title>
|
|
|
|
|
|
+ <title>配置选项的含义:</title>
|
|
|
|
|
|
<varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>--prefix=/tools</parameter></term>
|
|
<term><parameter>--prefix=/tools</parameter></term>
|
|
<listitem>
|
|
<listitem>
|
|
- <para>This tells the configure script to prepare to install the
|
|
|
|
- Binutils programs in the <filename class="directory">/tools</filename>
|
|
|
|
- directory.</para>
|
|
|
|
|
|
+ <para>这告诉配置脚本准备将 Binutils 程序安装在
|
|
|
|
+ <filename class="directory">/tools</filename> 目录中。</para>
|
|
</listitem>
|
|
</listitem>
|
|
</varlistentry>
|
|
</varlistentry>
|
|
|
|
|
|
<varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>--with-sysroot=$LFS</parameter></term>
|
|
<term><parameter>--with-sysroot=$LFS</parameter></term>
|
|
<listitem>
|
|
<listitem>
|
|
- <para>For cross compilation, this tells the build system to look in
|
|
|
|
- $LFS for the target system libraries as needed.</para>
|
|
|
|
|
|
+ <para>该选项告诉构建系统,交叉编译时在 $LFS 中寻找目标系统的库。
|
|
|
|
+ </para>
|
|
</listitem>
|
|
</listitem>
|
|
</varlistentry>
|
|
</varlistentry>
|
|
|
|
|
|
<varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>--with-lib-path=/tools/lib</parameter></term>
|
|
<term><parameter>--with-lib-path=/tools/lib</parameter></term>
|
|
<listitem>
|
|
<listitem>
|
|
- <para>This specifies which library path the linker should be
|
|
|
|
- configured to use.</para>
|
|
|
|
|
|
+ <para>该选项指定链接器应该使用的库文件搜索路径。</para>
|
|
</listitem>
|
|
</listitem>
|
|
</varlistentry>
|
|
</varlistentry>
|
|
|
|
|
|
<varlistentry>
|
|
<varlistentry>
|
|
<term><envar>--target=$LFS_TGT</envar></term>
|
|
<term><envar>--target=$LFS_TGT</envar></term>
|
|
<listitem>
|
|
<listitem>
|
|
- <para>Because the machine description in the <envar>LFS_TGT</envar>
|
|
|
|
- variable is slightly different than the value returned by the
|
|
|
|
- <command>config.guess</command> script, this switch will tell the
|
|
|
|
- <command>configure</command> script to adjust Binutil's build system
|
|
|
|
- for building a cross linker. </para>
|
|
|
|
|
|
+ <para>由于 <envar>LFS_TGT</envar> 变量中的机器描述和
|
|
|
|
+ <command>config.guess</command> 脚本的输出略有不同,
|
|
|
|
+ 这个开关使得 <command>configure</command> 脚本调整 Binutils
|
|
|
|
+ 的构建系统,以构建交叉链接器。</para>
|
|
</listitem>
|
|
</listitem>
|
|
</varlistentry>
|
|
</varlistentry>
|
|
|
|
|
|
<varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>--disable-nls</parameter></term>
|
|
<term><parameter>--disable-nls</parameter></term>
|
|
<listitem>
|
|
<listitem>
|
|
- <para>This disables internationalization as i18n is not needed for the
|
|
|
|
- temporary tools.</para>
|
|
|
|
|
|
+ <para>该选项禁用临时工具不需要的国际化功能。</para>
|
|
</listitem>
|
|
</listitem>
|
|
</varlistentry>
|
|
</varlistentry>
|
|
|
|
|
|
<varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>--disable-werror</parameter></term>
|
|
<term><parameter>--disable-werror</parameter></term>
|
|
<listitem>
|
|
<listitem>
|
|
- <para>This prevents the build from stopping in the event that there
|
|
|
|
- are warnings from the host's compiler.</para>
|
|
|
|
|
|
+ <para>该选项防止宿主系统编译器警告导致构建失败。</para>
|
|
</listitem>
|
|
</listitem>
|
|
</varlistentry>
|
|
</varlistentry>
|
|
|
|
|
|
</variablelist>
|
|
</variablelist>
|
|
|
|
|
|
- <para>Continue with compiling the package:</para>
|
|
|
|
|
|
+ <para>然后编译该软件包:</para>
|
|
|
|
|
|
<screen><userinput remap="make">make</userinput></screen>
|
|
<screen><userinput remap="make">make</userinput></screen>
|
|
|
|
|
|
- <para>Compilation is now complete. Ordinarily we would now run the
|
|
|
|
|
|
+ <!--para>Compilation is now complete. Ordinarily we would now run the
|
|
test suite, but at this early stage the test suite framework (Tcl,
|
|
test suite, but at this early stage the test suite framework (Tcl,
|
|
Expect, and DejaGNU) is not yet in place. The benefits of running the
|
|
Expect, and DejaGNU) is not yet in place. The benefits of running the
|
|
tests at this point are minimal since the programs from this
|
|
tests at this point are minimal since the programs from this
|
|
- first pass will soon be replaced by those from the second.</para>
|
|
|
|
|
|
+ first pass will soon be replaced by those from the second.</para-->
|
|
|
|
+ <para>之后编译就完成了。一般来说我们现在应该执行测试套件,
|
|
|
|
+ 但在这么早的构建阶段,测试套件框架 (Tcl、Expect 和 DejaGNU)
|
|
|
|
+ 都不可用。另外,由于这些第一轮的程序很快会被第二轮的程序替代,
|
|
|
|
+ 运行测试的收益极小。</para>
|
|
|
|
|
|
- <para>If building on x86_64, create a symlink to ensure the sanity of
|
|
|
|
- the toolchain:</para>
|
|
|
|
|
|
+ <para>如果在 x86_64 上编译,创建一个符号链接以保证工具链的完整性:
|
|
|
|
+ </para>
|
|
|
|
|
|
<screen><userinput remap="install">case $(uname -m) in
|
|
<screen><userinput remap="install">case $(uname -m) in
|
|
x86_64) mkdir -v /tools/lib && ln -sv lib /tools/lib64 ;;
|
|
x86_64) mkdir -v /tools/lib && ln -sv lib /tools/lib64 ;;
|
|
esac</userinput></screen>
|
|
esac</userinput></screen>
|
|
|
|
|
|
- <para>Install the package:</para>
|
|
|
|
|
|
+ <para>安装该软件包:</para>
|
|
|
|
|
|
<screen><userinput remap="install">make install</userinput></screen>
|
|
<screen><userinput remap="install">make install</userinput></screen>
|
|
|
|
|
|
@@ -162,8 +177,8 @@ esac</userinput></screen>
|
|
<sect2 role="content">
|
|
<sect2 role="content">
|
|
<title/>
|
|
<title/>
|
|
|
|
|
|
- <para>Details on this package are located in
|
|
|
|
- <xref linkend="contents-binutils" role="."/></para>
|
|
|
|
|
|
+ <para>这个软件包的细节在
|
|
|
|
+ <xref linkend="contents-binutils"/> 中可以找到。</para>
|
|
|
|
|
|
</sect2>
|
|
</sect2>
|
|
|
|
|