📄 adjusting.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> 10.9. Adjusting the Toolchain </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-MIPS64-Multilib"> <div class="navheader"> <div class="headertitles"> <h4> Cross-Compiled Linux From Scratch - Version CLFS-SVN-20060417-MIPS64-Multilib </h4> <h3> Chapter 10. Installing Basic System Software </h3> </div> <ul class="headerlinks"> <li class="prev"> <a accesskey="p" href="glibc-64bit.html" title= "Glibc-2.4 64-Bit">Prev</a> <p> Glibc-2.4 64-Bit </p> </li> <li class="next"> <a accesskey="n" href="binutils.html" title= "Binutils-2.16.1">Next</a> <p> Binutils-2.16.1 </p> </li> <li class="up"> <a accesskey="u" href="chapter.html" title= "Chapter 10. Installing Basic System Software">Up</a>. </li> <li class="home"> <a accesskey="h" href="../index.html" title= "Cross-Compiled Linux From Scratch - Version CLFS-SVN-20060417-MIPS64-Multilib"> Home</a> </li> </ul> </div> <div class="sect1" lang="en" xml:lang="en"> <div class="titlepage"> <h1 class="sect1"> 10.9. Adjusting the Toolchain </h1> </div> <p> Now we amend the GCC specs file so that it points to the new dynamic linker. A <span><strong class="command">perl</strong></span> command accomplishes this: </p> <pre class="userinput"><kbd class="command">gcc -dumpspecs | \perl -p -e 's@/tools/lib/ld@/lib/ld@g;' \ -e 's@/tools/lib32/ld@/lib32/ld@g;' \ -e 's@/tools/lib64/ld@/lib64/ld@g;' \ -e 's@\*startfile_prefix_spec:\n@$_/usr/lib/ @g;' > \ `dirname $(gcc --print-libgcc-file-name)`/specs</kbd></pre> <p> It is a good idea to visually inspect the specs file to verify the intended change was actually made. </p> <p> Note that <tt class="filename">/lib</tt>, <tt class= "filename">/lib32</tt>, or <tt class="filename">/lib64</tt> is now the prefix of our dynamic linker. </p> <div class="caution"> <div class="admonhead"> <img alt="[Caution]" src="../images/caution.png" /> <h3 class="admontitle"> Caution </h3> </div> <div class="admonbody"> <p> It is imperative at this point to stop and ensure that the basic functions (compiling and linking) of the adjusted toolchain are working as expected. To do this, perform a sanity check: </p> <p> For 32 bit ABI: </p> <pre class="userinput"><kbd class="command">echo 'main(){}' > dummy.ccc ${BUILD32} dummy.creadelf -l a.out | grep ': /lib'</kbd></pre> <p> If everything is working correctly, there should be no errors, and the output of the last command will be: </p> <pre class="screen"><tt class="computeroutput">[Requesting program interpreter: /lib/ld.so.1]</tt></pre> <p> For N32 ABI: </p> <pre class="userinput"><kbd class="command">echo 'main(){}' > dummy.ccc ${BUILDN32} dummy.creadelf -l a.out | grep ': /lib'</kbd></pre> <p> If everything is working correctly, there should be no errors, and the output of the last command will be: </p> <pre class="screen"><tt class="computeroutput">[Requesting program interpreter: /lib32/ld.so.1]</tt></pre> <p> For 64 bit ABI: </p> <pre class="userinput"><kbd class="command">echo 'main(){}' > dummy.ccc ${BUILD64} dummy.creadelf -l a.out | grep ': /lib'</kbd></pre> <p> If everything is working correctly, there should be no errors, and the output of the last command will be: </p> <pre class="screen"><tt class="computeroutput">[Requesting program interpreter: /lib64/ld.so.1]</tt></pre> <p> Note that <tt class="filename">/lib</tt>, <tt class= "filename">/lib32</tt> or <tt class="filename">/lib64</tt> is now the prefix of our dynamic linker. </p> <p> If the output does not appear as shown above or is not received at all, then something is seriously wrong. Investigate and retrace the steps to find out where the problem is and correct it. The most likely reason is that something went wrong with the specs file amendment above. Any issues will need to be resolved before continuing on with the process. </p> <p> Once everything is working correctly, clean up the test files: </p> <pre class="userinput"><kbd class="command">rm -v dummy.c a.out</kbd></pre> </div> </div> </div> <div class="navfooter"> <ul> <li class="prev"> <a accesskey="p" href="glibc-64bit.html" title= "Glibc-2.4 64-Bit">Prev</a> <p> Glibc-2.4 64-Bit </p> </li> <li class="next"> <a accesskey="n" href="binutils.html" title= "Binutils-2.16.1">Next</a> <p> Binutils-2.16.1 </p> </li> <li class="up"> <a accesskey="u" href="chapter.html" title= "Chapter 10. Installing Basic System Software">Up</a>. </li> <li class="home"> <a accesskey="h" href="../index.html" title= "Cross-Compiled Linux From Scratch - Version CLFS-SVN-20060417-MIPS64-Multilib"> Home</a>. </li> </ul> </div> </body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -