- Timestamp:
- 08/07/2007 08:24:04 PM (17 years ago)
- Children:
- 71f6077
- Parents:
- 400af5a8
- Location:
- chapter05
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter05/adjusting.xml
r400af5a8 rda2f9fe 37 37 <para>For the sake of accuracy, it is recommended to use a copy-and-paste 38 38 method when issuing the following command. Be sure to visually inspect the 39 specs file and verify that all occurrences of <quote>/lib 64/ld-linux-x86-64.so.2</quote>40 have been replaced with <quote>/tools/lib 64/ld-linux-x86-64.so.2</quote>:</para>39 specs file and verify that all occurrences of <quote>/lib/ld-linux.so.2</quote> 40 have been replaced with <quote>/tools/lib/ld-linux.so.2</quote>:</para> 41 41 42 42 <important> 43 43 <para>If working on a platform where the name of the dynamic linker is 44 something other than <filename class="libraryfile">ld-linux -x86-64.so.2</filename>,45 replace <quote>ld-linux -x86-64.so.2</quote> with the name of the platform's44 something other than <filename class="libraryfile">ld-linux.so.2</filename>, 45 replace <quote>ld-linux.so.2</quote> with the name of the platform's 46 46 dynamic linker in the following commands. Refer to <xref 47 linkend="ch-tools-toolchaintechnotes" role=","/> if necessary.</para> 47 linkend="ch-tools-toolchaintechnotes" role=","/> if necessary. Additionally, 48 note that on 64-bit machines the linker may actually be expected in the 49 <filename class="directory">/lib64</filename> directory.</para> 48 50 </important> 49 51 50 52 <!-- Ampersands are needed to allow copy and paste --> 51 <screen><userinput>gcc -dumpspecs | sed 's@/lib 64/ld-linux-x86-64.so.2@/tools&@g' \52 >`dirname $(gcc -print-libgcc-file-name)`/specs</userinput></screen>53 <screen><userinput>gcc -dumpspecs | sed 's@/lib\(64\)\?/ld@/tools&@g' \ 54 > `dirname $(gcc -print-libgcc-file-name)`/specs</userinput></screen> 53 55 54 56 <para>During the build process, GCC runs a script … … 85 87 86 88 <screen><computeroutput>[Requesting program interpreter: 87 /tools/lib 64/ld-linux-x86-64.so.2]</computeroutput></screen>89 /tools/lib/ld-linux.so.2]</computeroutput></screen> 88 90 89 <para>Note that <filename class="directory">/tools/lib</filename> 91 <para>Note that <filename class="directory">/tools/lib</filename>, or 92 <filename class="directory">/tools/lib64</filename> for 64-bit machines 90 93 appears as the prefix of the dynamic linker.</para> 91 94 -
chapter05/toolchaintechnotes.xml
r400af5a8 rda2f9fe 28 28 <important> 29 29 <para>Before continuing, be aware of the name of the working platform, 30 often referred to as the target triplet. Many times, the target31 triplet will probably be <emphasis>x86_64-unknown-linux-gnu</emphasis>. A32 s imple way to determine the name of the target triplet is to run the33 <command>config.guess</command> script that comes with the source for34 many packages. Unpack the Binutils sources and run the script:35 <userinput>./config.guess</userinput> and note the output.</para>30 often referred to as the target triplet. A simple way to determine the 31 name of the target triplet is to run the <command>config.guess</command> 32 script that comes with the source for many packages. Unpack the Binutils 33 sources and run the script: <userinput>./config.guess</userinput> and note 34 the output. For example, for a modern 32-bit Intel processor the 35 output will likely be <emphasis>i686-pc-linux-gnu</emphasis>.</para> 36 36 37 37 <para>Also be aware of the name of the platform's dynamic linker, often … … 40 40 provided by Glibc finds and loads the shared libraries needed by a program, 41 41 prepares the program to run, and then runs it. The name of the dynamic 42 linker will usually be <filename class="libraryfile">ld-linux-x86-64.so.2</filename>. 43 The name of the platform's dynamic linker can be determined by looking in the 44 <filename class="directory">/lib</filename> 45 directory on the host system. A sure-fire way to determine the name is to 42 linker for a 32-bit Intel machine will be 43 <filename class="libraryfile">ld-linux.so.2</filename>. 44 A sure-fire way to determine the name of the dynamic linker is to 46 45 inspect a random binary from the host system by running: 47 46 <userinput>readelf -l <name of binary> | grep interpreter</userinput> … … 97 96 98 97 <screen><computeroutput>checking what assembler to use... 99 /tools/ x86_64-unknown-linux-gnu/bin/as100 checking what linker to use... /tools/ x86_64-unknown-linux-gnu/bin/ld</computeroutput></screen>98 /tools/i686-pc-linux-gnu/bin/as 99 checking what linker to use... /tools/i686-pc-linux-gnu/bin/ld</computeroutput></screen> 101 100 102 101 <para>This is important for the reasons mentioned above. It also demonstrates
Note:
See TracChangeset
for help on using the changeset viewer.