📄 binutils.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content= "application/xhtml+xml; charset=iso-8859-1" /> <title> 5.5. Cross Binutils-2.16.1 </title> <link rel="stylesheet" href="../stylesheets/lfs.css" type="text/css" /> <meta name="generator" content="DocBook XSL Stylesheets V1.69.1" /> <link rel="stylesheet" href="../stylesheets/lfs-print.css" type= "text/css" media="print" /> </head> <body id="lfs" class="CLFS-SVN-20060417-MIPS"> <div class="navheader"> <div class="headertitles"> <h4> Cross-Compiled Linux From Scratch - Version CLFS-SVN-20060417-MIPS </h4> <h3> Chapter 5. Constructing Cross-Compile Tools </h3> </div> <ul class="headerlinks"> <li class="prev"> <a accesskey="p" href="linux-libc-headers.html" title= "Linux-Libc-Headers-2.6.12.0">Prev</a> <p> Linux-Libc-Headers-2.6.12.0 </p> </li> <li class="next"> <a accesskey="n" href="gcc-static.html" title= "Cross GCC-4.1.0 - Static">Next</a> <p> Cross GCC-4.1.0 - Static </p> </li> <li class="up"> <a accesskey="u" href="chapter.html" title= "Chapter 5. Constructing Cross-Compile Tools">Up</a>. </li> <li class="home"> <a accesskey="h" href="../index.html" title= "Cross-Compiled Linux From Scratch - Version CLFS-SVN-20060417-MIPS"> Home</a> </li> </ul> </div> <div class="wrap" lang="en" xml:lang="en"> <div class="titlepage"> <h1 class="sect1"> 5.5. Cross Binutils-2.16.1 </h1> </div> <div class="package" lang="en" xml:lang="en"> <p> The Binutils package contains a linker, an assembler, and other tools for handling object files. </p> <div class="segmentedlist"> <div class="seglistitem"> <div class="seg"> <strong><span class="segtitle">Installation depends on:</span></strong> <span class="seg">Bash, Binutils, Coreutils, Diffutils, Expect, GCC, Gettext, Glibc, Grep, Make, Patch, Perl, Sed, Tcl, and Texinfo</span> </div> </div> </div> </div> <div class="installation" lang="en" xml:lang="en"> <div class="titlepage"> <h2 class="sect2"> 5.5.1. Installation of Cross Binutils </h2> </div> <p> It is important that Binutils be the first package compiled because both Glibc and GCC perform various tests on the available linker and assembler to determine which of their own features to enable. </p> <p> To make sure that the proper syntax is used for a couple of tools, apply the following patch: </p> <pre class="userinput"><kbd class="command">patch -Np1 -i ../binutils-2.16.1-posix-1.patch</kbd></pre> <p> The Binutils documentation recommends building Binutils outside of the source directory in a dedicated build directory: </p> <pre class="userinput"><kbd class="command">mkdir -v ../binutils-buildcd ../binutils-build</kbd></pre> <p> Prepare Binutils for compilation: </p> <pre class="userinput"><kbd class="command">../binutils-2.16.1/configure --prefix=/cross-tools \ --host=${LFS_HOST} --target=${LFS_TARGET} --with-lib-path=/tools/lib \ --disable-nls --enable-shared --disable-multilib</kbd></pre> <div class="variablelist"> <p class="title"> <b>The meaning of the configure options:</b> </p> <dl> <dt> <span class="term"><em class= "parameter"><tt>--prefix=/cross-tools</tt></em></span> </dt> <dd> <p> This tells the configure script to prepare to install the package in the <tt class="filename">/cross-tools</tt> directory. </p> </dd> <dt> <span class="term"><em class= "parameter"><tt>--host=${LFS_HOST}</tt></em></span> </dt> <dd> <p> When used with --target, this creates a cross-architecture executable that creates files for ${LFS_TARGET} but runs on ${LFS_HOST). </p> </dd> <dt> <span class="term"><em class= "parameter"><tt>--target=${LFS_TARGET}</tt></em></span> </dt> <dd> <p> When used with --host, this creates a cross-architecture executable that creates files for ${LFS_TARGET} but runs on ${LFS_HOST). </p> </dd> <dt> <span class="term"><em class= "parameter"><tt>--with-lib-path=/tools/lib</tt></em></span> </dt> <dd> <p> This tells the configure script to specify the library search path during the compilation of Binutils, resulting in <tt class="filename">/tools/lib</tt> being passed to the linker. This prevents the linker from searching through library directories on the host. </p> </dd> <dt> <span class="term"><em class= "parameter"><tt>--disable-nls</tt></em></span> </dt> <dd> <p> This disables internationalization as i18n is not needed for the cross-compile tools. </p> </dd> <dt> <span class="term"><em class= "parameter"><tt>--enable-shared</tt></em></span> </dt> <dd> <p> Enable the creation of the shared libraries. </p> </dd> <dt> <span class="term"><em class= "parameter"><tt>--disable-multilib</tt></em></span> </dt> <dd> <p> This option disables the building of a multilib capable binutils. </p> </dd> </dl> </div> <p> Compile the package: </p> <pre class="userinput"><kbd class="command">make configure-hostmake</kbd></pre> <div class="variablelist"> <p class="title"> <b>The meaning of the make options:</b> </p> <dl> <dt> <span class="term"><em class= "parameter"><tt>configure-host</tt></em></span> </dt> <dd> <p> This checks the host environment and makes sure all the necessary tools are available to compile binutils. </p> </dd> </dl> </div> <p> Install the package: </p> <pre class="userinput"><kbd class="command">make install</kbd></pre> <p> Copy the <tt class="filename">libiberty.h</tt> file to <tt class= "filename">/tools/include</tt> directory: </p> <pre class="userinput"><kbd class="command">cp -v ../binutils-2.16.1/include/libiberty.h /tools/include</kbd></pre> </div> <div class="content" lang="en" xml:lang="en"> <p> Details on this package are located in <a href= "../final-system/binutils.html#contents-binutils" title= "10.8.2. Contents of Binutils">Section 10.8.2, “Contents of Binutils.”</a> </p> </div> </div> <div class="navfooter"> <ul> <li class="prev"> <a accesskey="p" href="linux-libc-headers.html" title= "Linux-Libc-Headers-2.6.12.0">Prev</a> <p> Linux-Libc-Headers-2.6.12.0 </p> </li> <li class="next"> <a accesskey="n" href="gcc-static.html" title= "Cross GCC-4.1.0 - Static">Next</a> <p> Cross GCC-4.1.0 - Static </p> </li> <li class="up"> <a accesskey="u" href="chapter.html" title= "Chapter 5. Constructing Cross-Compile Tools">Up</a>. </li> <li class="home"> <a accesskey="h" href="../index.html" title= "Cross-Compiled Linux From Scratch - Version CLFS-SVN-20060417-MIPS"> Home</a>. </li> </ul> </div> </body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -