Browse Source

Some adjustments that were missed the first time:
- Changed instances of dynamic linker name
- Changed instances of target triplet
- Update gcc pure64_specs patch
- Use gcc pure64 patch in final gcc
- Use --disable-multilib in final gcc and binutils
- Explicitly tell Glibc to use /lib and /usr/lib, instead
of defaults of /lib64 and /usr/lib64


git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/x86_64/BOOK@8232 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

Jeremy Huntwork 18 years ago
parent
commit
2b75709a4d

+ 4 - 4
chapter05/adjusting.xml

@@ -36,13 +36,13 @@ ln -sv /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld</userinput></screen>
 
 
   <para>For the sake of accuracy, it is recommended to use a copy-and-paste
   <para>For the sake of accuracy, it is recommended to use a copy-and-paste
   method when issuing the following command. Be sure to visually inspect the
   method when issuing the following command. Be sure to visually inspect the
-  specs file and verify that all occurrences of <quote>/lib/ld-linux.so.2</quote>
-  have been replaced with <quote>/tools/lib/ld-linux.so.2</quote>:</para>
+  specs file and verify that all occurrences of <quote>/lib/ld-linux-x86-64.so.2</quote>
+  have been replaced with <quote>/tools/lib/ld-linux-x86-64.so.2</quote>:</para>
 
 
   <important>
   <important>
     <para>If working on a platform where the name of the dynamic linker is
     <para>If working on a platform where the name of the dynamic linker is
-    something other than <filename class="libraryfile">ld-linux.so.2</filename>,
-    replace <quote>ld-linux.so.2</quote> with the name of the platform's
+    something other than <filename class="libraryfile">ld-linux-x86-64.so.2</filename>,
+    replace <quote>ld-linux-x86-64.so.2</quote> with the name of the platform's
     dynamic linker in the following commands. Refer to <xref
     dynamic linker in the following commands. Refer to <xref
     linkend="ch-tools-toolchaintechnotes" role=","/> if necessary.</para>
     linkend="ch-tools-toolchaintechnotes" role=","/> if necessary.</para>
   </important>
   </important>

+ 6 - 8
chapter05/toolchaintechnotes.xml

@@ -28,7 +28,7 @@
   <important>
   <important>
     <para>Before continuing, be aware of the name of the working platform,
     <para>Before continuing, be aware of the name of the working platform,
     often referred to as the target triplet. Many times, the target
     often referred to as the target triplet. Many times, the target
-    triplet will probably be <emphasis>i686-pc-linux-gnu</emphasis>. A
+    triplet will probably be <emphasis>x86_64-unknown-linux-gnu</emphasis>. A
     simple way to determine the name of the target triplet is to run the
     simple way to determine the name of the target triplet is to run the
     <command>config.guess</command> script that comes with the source for
     <command>config.guess</command> script that comes with the source for
     many packages. Unpack the Binutils sources and run the script:
     many packages. Unpack the Binutils sources and run the script:
@@ -39,11 +39,9 @@
     linker <command>ld</command> that is part of Binutils). The dynamic linker
     linker <command>ld</command> that is part of Binutils). The dynamic linker
     provided by Glibc finds and loads the shared libraries needed by a program,
     provided by Glibc finds and loads the shared libraries needed by a program,
     prepares the program to run, and then runs it. The name of the dynamic
     prepares the program to run, and then runs it. The name of the dynamic
-    linker will usually be <filename class="libraryfile">ld-linux.so.2</filename>.
-    On platforms that are less prevalent, the name might be <filename
-    class="libraryfile">ld.so.1</filename>, and newer 64 bit platforms might
-    be named something else entirely. The name of the platform's dynamic linker
-    can be determined by looking in the <filename class="directory">/lib</filename>
+    linker will usually be <filename class="libraryfile">ld-linux-x86-64.so.2</filename>.
+    The name of the platform's dynamic linker can be determined by looking in the
+    <filename class="directory">/lib</filename>
     directory on the host system. A sure-fire way to determine the name is to
     directory on the host system. A sure-fire way to determine the name is to
     inspect a random binary from the host system by running:
     inspect a random binary from the host system by running:
     <userinput>readelf -l &lt;name of binary&gt; | grep interpreter</userinput>
     <userinput>readelf -l &lt;name of binary&gt; | grep interpreter</userinput>
@@ -98,8 +96,8 @@
   seen during its run of <command>configure</command> is:</para>
   seen during its run of <command>configure</command> is:</para>
 
 
 <screen><computeroutput>checking what assembler to use...
 <screen><computeroutput>checking what assembler to use...
-        /tools/i686-pc-linux-gnu/bin/as
-checking what linker to use... /tools/i686-pc-linux-gnu/bin/ld</computeroutput></screen>
+        /tools/x86_64-unknown-linux-gnu/bin/as
+checking what linker to use... /tools/x86_64-unknown-linux-gnu/bin/ld</computeroutput></screen>
 
 
   <para>This is important for the reasons mentioned above. It also demonstrates
   <para>This is important for the reasons mentioned above. It also demonstrates
   that GCC's configure script does not search the PATH directories to find which
   that GCC's configure script does not search the PATH directories to find which

+ 3 - 3
chapter06/binutils.xml

@@ -59,7 +59,7 @@ cd ../binutils-build</userinput></screen>
     <para>Prepare Binutils for compilation:</para>
     <para>Prepare Binutils for compilation:</para>
 
 
 <screen><userinput>../binutils-&binutils-version;/configure --prefix=/usr \
 <screen><userinput>../binutils-&binutils-version;/configure --prefix=/usr \
-    --enable-shared</userinput></screen>
+    --enable-shared --disable-multilib</userinput></screen>
 
 
     <para>Compile the package:</para>
     <para>Compile the package:</para>
 
 
@@ -74,8 +74,8 @@ cd ../binutils-build</userinput></screen>
           <para>Normally, the tooldir (the directory where the executables will
           <para>Normally, the tooldir (the directory where the executables will
           ultimately be located) is set to <filename
           ultimately be located) is set to <filename
           class="directory">$(exec_prefix)/$(target_alias)</filename>. For
           class="directory">$(exec_prefix)/$(target_alias)</filename>. For
-          example, i686 machines would expand that to <filename
-          class="directory">/usr/i686-pc-linux-gnu</filename>. Because this is
+          example, x86_64 machines would expand that to <filename
+          class="directory">/usr/x86_64-unknown-linux-gnu</filename>. Because this is
           a custom system, this target-specific directory in <filename
           a custom system, this target-specific directory in <filename
           class="directory">/usr</filename> is not required. <filename
           class="directory">/usr</filename> is not required. <filename
           class="directory">$(exec_prefix)/$(target_alias)</filename> would be
           class="directory">$(exec_prefix)/$(target_alias)</filename> would be

+ 12 - 6
chapter06/gcc.xml

@@ -35,6 +35,11 @@
   <sect2 role="installation">
   <sect2 role="installation">
     <title>Installation of GCC</title>
     <title>Installation of GCC</title>
 
 
+    <para>The following patch tells GCC to link to <filename class="directory">
+    /lib</filename> instead of <filename class="directory">/lib64</filename>.</para>
+
+<screen><userinput>patch -Np1 -i ../&gcc-pure64-patch;</userinput></screen>
+
     <para>Apply a <command>sed</command> substitution that will suppress the
     <para>Apply a <command>sed</command> substitution that will suppress the
     installation of <filename class="libraryfile">libiberty.a</filename>. The
     installation of <filename class="libraryfile">libiberty.a</filename>. The
     version of <filename class="libraryfile">libiberty.a</filename> provided by
     version of <filename class="libraryfile">libiberty.a</filename> provided by
@@ -77,7 +82,8 @@ cd ../gcc-build</userinput></screen>
 <screen><userinput>../gcc-&gcc-version;/configure --prefix=/usr \
 <screen><userinput>../gcc-&gcc-version;/configure --prefix=/usr \
     --libexecdir=/usr/lib --enable-shared \
     --libexecdir=/usr/lib --enable-shared \
     --enable-threads=posix --enable-__cxa_atexit \
     --enable-threads=posix --enable-__cxa_atexit \
-    --enable-clocale=gnu --enable-languages=c,c++</userinput></screen>
+    --enable-clocale=gnu --enable-languages=c,c++ \
+    --disable-multilib</userinput></screen>
 
 
     <para>Compile the package:</para>
     <para>Compile the package:</para>
 
 
@@ -153,9 +159,9 @@ cd ../gcc-build</userinput></screen>
     href="readjusting.xml"
     href="readjusting.xml"
     xpointer="xpointer(//*[@os='f'])"/>
     xpointer="xpointer(//*[@os='f'])"/>
 
 
-<screen><computeroutput>/usr/lib/gcc/i686-pc-linux-gnu/&gcc-version;/../../../crt1.o succeeded
-/usr/lib/gcc/i686-pc-linux-gnu/&gcc-version;/../../../crti.o succeeded
-/usr/lib/gcc/i686-pc-linux-gnu/&gcc-version;/../../../crtn.o succeeded</computeroutput></screen>
+<screen><computeroutput>/usr/lib/gcc/x86_64-unknown-linux-gnu/&gcc-version;/../../../crt1.o succeeded
+/usr/lib/gcc/x86_64-unknown-linux-gnu/&gcc-version;/../../../crti.o succeeded
+/usr/lib/gcc/x86_64-unknown-linux-gnu/&gcc-version;/../../../crtn.o succeeded</computeroutput></screen>
 
 
     <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
     <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
     href="readjusting.xml"
     href="readjusting.xml"
@@ -169,7 +175,7 @@ cd ../gcc-build</userinput></screen>
 
 
 <screen><computeroutput>#include &lt;...&gt; search starts here:
 <screen><computeroutput>#include &lt;...&gt; search starts here:
  /usr/local/include
  /usr/local/include
- /usr/lib/gcc/i686-pc-linux-gnu/&gcc-version;/include
+ /usr/lib/gcc/x86_64-unknown-linux-gnu/&gcc-version;/include
  /usr/include</computeroutput></screen>
  /usr/include</computeroutput></screen>
 
 
     <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
     <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
@@ -184,7 +190,7 @@ cd ../gcc-build</userinput></screen>
     href="readjusting.xml"
     href="readjusting.xml"
     xpointer="xpointer(//*[@os='k'])"/>
     xpointer="xpointer(//*[@os='k'])"/>
 
 
-<screen><computeroutput>SEARCH_DIR("/usr/i686-pc-linux-gnu/lib")
+<screen><computeroutput>SEARCH_DIR("/usr/x86_64-unknown-linux-gnu/lib")
 SEARCH_DIR("/usr/local/lib")
 SEARCH_DIR("/usr/local/lib")
 SEARCH_DIR("/lib")
 SEARCH_DIR("/lib")
 SEARCH_DIR("/usr/lib");</computeroutput></screen>
 SEARCH_DIR("/usr/lib");</computeroutput></screen>

+ 6 - 1
chapter06/glibc.xml

@@ -101,11 +101,16 @@ mv glibc-libidn-&glibc-version; libidn</userinput></screen>
 <screen><userinput>mkdir -v ../glibc-build
 <screen><userinput>mkdir -v ../glibc-build
 cd ../glibc-build</userinput></screen>
 cd ../glibc-build</userinput></screen>
 
 
+    <para>Tell Glibc to install its libraries in a more generic location:</para>
+
+<screen><userinput>echo "slibdir=/lib" &gt; configparms</userinput></screen>
+
     <para>Prepare Glibc for compilation:</para>
     <para>Prepare Glibc for compilation:</para>
 
 
 <screen><userinput>../glibc-&glibc-version;/configure --prefix=/usr \
 <screen><userinput>../glibc-&glibc-version;/configure --prefix=/usr \
     --disable-profile --enable-add-ons \
     --disable-profile --enable-add-ons \
-    --enable-kernel=2.6.0 --libexecdir=/usr/lib/glibc</userinput></screen>
+    --enable-kernel=2.6.0 --libexecdir=/usr/lib/glibc \
+    --libdir=/usr/lib</userinput></screen>
 
 
     <variablelist>
     <variablelist>
       <title>The meaning of the new configure options:</title>
       <title>The meaning of the new configure options:</title>

+ 6 - 6
chapter06/readjusting.xml

@@ -39,14 +39,14 @@ ln -sv /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld</userinput></screen>
 
 
   <important>
   <important>
     <para>If working on a platform where the name of the dynamic linker is
     <para>If working on a platform where the name of the dynamic linker is
-    something other than <filename class="libraryfile">ld-linux.so.2</filename>,
-    substitute <quote>ld-linux.so.2</quote> with the name of the platform's
+    something other than <filename class="libraryfile">ld-linux-x86-64.so.2</filename>,
+    substitute <quote>ld-linux-x86-64.so.2</quote> with the name of the platform's
     dynamic linker in the following commands. Refer to <xref
     dynamic linker in the following commands. Refer to <xref
     linkend="ch-tools-toolchaintechnotes" role=","/> if necessary.</para>
     linkend="ch-tools-toolchaintechnotes" role=","/> if necessary.</para>
   </important>
   </important>
 
 
 <screen><userinput>gcc -dumpspecs | sed \
 <screen><userinput>gcc -dumpspecs | sed \
-    -e 's@/tools/lib/ld-linux.so.2@/lib/ld-linux.so.2@g' \
+    -e 's@/tools/lib/ld-linux-x86-64.so.2@/lib/ld-linux-x86-64.so.2@g' \
     -e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \
     -e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \
     -e '/\*cpp:/{n;s@$@ -isystem /usr/include@}' &gt; \
     -e '/\*cpp:/{n;s@$@ -isystem /usr/include@}' &gt; \
     `dirname $(gcc --print-libgcc-file-name)`/specs</userinput></screen>
     `dirname $(gcc --print-libgcc-file-name)`/specs</userinput></screen>
@@ -66,7 +66,7 @@ readelf -l a.out | grep ': /lib'</userinput></screen>
   and the output of the last command will be (allowing for
   and the output of the last command will be (allowing for
   platform-specific differences in dynamic linker name):</para>
   platform-specific differences in dynamic linker name):</para>
 
 
-<screen os="c"><computeroutput>[Requesting program interpreter: /lib/ld-linux.so.2]</computeroutput></screen>
+<screen os="c"><computeroutput>[Requesting program interpreter: /lib/ld-linux-x86-64.so.2]</computeroutput></screen>
 
 
   <para>Note that <filename class="directory">/lib</filename> is now
   <para>Note that <filename class="directory">/lib</filename> is now
   the prefix of our dynamic linker.</para>
   the prefix of our dynamic linker.</para>
@@ -99,7 +99,7 @@ readelf -l a.out | grep ': /lib'</userinput></screen>
   <para os="k">If everything is working correctly, there should be no errors,
   <para os="k">If everything is working correctly, there should be no errors,
   and the output of the last command will be:</para>
   and the output of the last command will be:</para>
 
 
-<screen><computeroutput>SEARCH_DIR("/tools/i686-pc-linux-gnu/lib")
+<screen><computeroutput>SEARCH_DIR("/tools/x86_64-unknown-linux-gnu/lib")
 SEARCH_DIR("/usr/lib")
 SEARCH_DIR("/usr/lib")
 SEARCH_DIR("/lib");</computeroutput></screen>
 SEARCH_DIR("/lib");</computeroutput></screen>
 
 
@@ -120,7 +120,7 @@ SEARCH_DIR("/lib");</computeroutput></screen>
   and the output of the last command will be (allowing for
   and the output of the last command will be (allowing for
   platform-specific differences in dynamic linker name):</para>
   platform-specific differences in dynamic linker name):</para>
 
 
-<screen os="s"><computeroutput>found ld-linux.so.2 at /lib/ld-linux.so.2</computeroutput></screen>
+<screen os="s"><computeroutput>found ld-linux-x86-64.so.2 at /lib/ld-linux-x86-64.so.2</computeroutput></screen>
 
 
   <para os="t">If the output does not appear as shown above or is not received
   <para os="t">If the output does not appear as shown above or is not received
   at all, then something is seriously wrong. Investigate and retrace the
   at all, then something is seriously wrong. Investigate and retrace the

+ 3 - 3
patches.ent

@@ -47,9 +47,9 @@
 <!ENTITY gcc-pure64-patch-md5 "cea9bf46663392d627de81e2456698e3">
 <!ENTITY gcc-pure64-patch-md5 "cea9bf46663392d627de81e2456698e3">
 <!ENTITY gcc-pure64-patch-size "6.7 KB">
 <!ENTITY gcc-pure64-patch-size "6.7 KB">
 
 
-<!ENTITY gcc-pure64-specs-patch "gcc-&gcc-version;-pure64_specs-1.patch">
-<!ENTITY gcc-pure64-specs-patch-md5 "99e0ae890fce0614be210e83f0a5b975">
-<!ENTITY gcc-pure64-specs-patch-size "15 KB">
+<!ENTITY gcc-pure64-specs-patch "gcc-&gcc-version;-pure64_specs-2.patch">
+<!ENTITY gcc-pure64-specs-patch-md5 "95b4541d7fa0e9a11f23af6db8b303d8">
+<!ENTITY gcc-pure64-specs-patch-size "17 KB">
 
 
 <!ENTITY glibc-branch_update-patch "glibc-&glibc-version;-branch_update-3.patch">
 <!ENTITY glibc-branch_update-patch "glibc-&glibc-version;-branch_update-3.patch">
 <!ENTITY glibc-branch_update-patch-md5 "cbad3863a39eed9e52af083c5035f283">
 <!ENTITY glibc-branch_update-patch-md5 "cbad3863a39eed9e52af083c5035f283">