Sfoglia il codice sorgente

Bring the x86_64 build to working order.

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/x86_64/BOOK@8241 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Jeremy Huntwork 18 anni fa
parent
commit
dde6e423ad

+ 3 - 11
chapter03/patches.xml

@@ -91,18 +91,10 @@
     </varlistentry>
 
     <varlistentry>
-      <term>GCC 64-bit Specs Patch - <token>&gcc-pure64-specs-patch-size;</token>:</term>
+      <term>GCC Specs Patch - <token>&gcc-specs-patch-size;</token>:</term>
       <listitem>
-        <para>Download: <ulink url="&patches-root;&gcc-pure64-specs-patch;"/></para>
-        <para>MD5 sum: <literal>&gcc-pure64-specs-patch-md5;</literal></para>
-      </listitem>
-    </varlistentry>
-
-    <varlistentry>
-      <term>GCC Pure64 Patch - <token>&gcc-pure64-patch-size;</token>:</term>
-      <listitem>
-        <para>Download: <ulink url="&patches-root;&gcc-pure64-patch;"/></para>
-        <para>MD5 sum: <literal>&gcc-pure64-patch-md5;</literal></para>
+        <para>Download: <ulink url="&patches-root;&gcc-specs-patch;"/></para>
+        <para>MD5 sum: <literal>&gcc-specs-patch-md5;</literal></para>
       </listitem>
     </varlistentry>
 

+ 6 - 0
chapter04/creatingtoolsdir.xml

@@ -45,4 +45,10 @@
   (when we are still using some tools from the host) and in the next (when
   we are <quote>chrooted</quote> to the LFS partition).</para>
 
+  <para>Set up a lib dir and appropriate symlink for 64-bit usability.</para>
+
+<screen><userinput>mkdir -v /tools/lib
+ln -sv lib /tools/lib64</userinput></screen>
+  
+
 </sect1>

+ 1 - 1
chapter05/adjusting.xml

@@ -48,7 +48,7 @@ ln -sv /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld</userinput></screen>
   </important>
 
 <!-- Ampersands are needed to allow copy and paste -->
-<screen><userinput>gcc -dumpspecs | sed 's@/lib/ld-linux-x86-64.so.2@/tools&amp;@g' \
+<screen><userinput>gcc -dumpspecs | sed 's@/lib64/ld-linux-x86-64.so.2@/tools&amp;@g' \
   > `dirname $(gcc -print-libgcc-file-name)`/specs</userinput></screen>
 
   <para>During the build process, GCC runs a script

+ 1 - 8
chapter05/binutils-pass1.xml

@@ -60,7 +60,7 @@ cd ../binutils-build</userinput></screen>
     <para>Now prepare Binutils for compilation:</para>
 
 <screen><userinput>CC="gcc -B/usr/bin/" ../binutils-&binutils-version;/configure \
-    --prefix=/tools --disable-nls --disable-multilib</userinput></screen>
+    --prefix=/tools --disable-nls</userinput></screen>
 
     <variablelist>
       <title>The meaning of the configure options:</title>
@@ -93,13 +93,6 @@ cd ../binutils-build</userinput></screen>
         </listitem>
       </varlistentry>
 
-      <varlistentry>
-        <term><parameter>--disable-multilib</parameter></term>
-        <listitem>
-          <para>We currently only want to build support for 64-bit libraries.</para>
-        </listitem>
-      </varlistentry>
-
     </variablelist>
 
     <para>Continue with compiling the package:</para>

+ 1 - 2
chapter05/binutils-pass2.xml

@@ -45,8 +45,7 @@ cd ../binutils-build</userinput></screen>
     <para>Prepare Binutils for compilation:</para>
 
 <screen><userinput>../binutils-&binutils-version;/configure --prefix=/tools \
-    --disable-nls --with-lib-path=/tools/lib \
-    --disable-multilib</userinput></screen>
+    --disable-nls --with-lib-path=/tools/lib</userinput></screen>
 
     <variablelist>
       <title>The meaning of the new configure options:</title>

+ 0 - 5
chapter05/gcc-pass1.xml

@@ -37,11 +37,6 @@
   <sect2 role="installation">
     <title>Installation of GCC</title>
 
-    <para>Apply a small patch that changes the default location for
-    64-bit libraries:</para>
-
-<screen><userinput>patch -Np1 -i ../&gcc-pure64-patch;</userinput></screen>
-
     <para>The GCC documentation recommends building GCC outside of the
     source directory in a dedicated build directory:</para>
 

+ 8 - 6
chapter05/gcc-pass2.xml

@@ -88,7 +88,7 @@ sed 's/^XCFLAGS =$/&amp; -fomit-frame-pointer/' gcc/Makefile.in.tmp \
     dynamic linker (typically <filename
     class="libraryfile">ld-linux-x86-64.so.2</filename>):</para>
 
-<screen><userinput>patch -Np1 -i ../&gcc-pure64-specs-patch;</userinput></screen>
+<screen><userinput>patch -Np1 -i ../&gcc-specs-patch;</userinput></screen>
 
     <para>The above patch also removes <filename
     class="directory">/usr/include</filename> from GCC's include search path.
@@ -102,6 +102,13 @@ sed 's/^XCFLAGS =$/&amp; -fomit-frame-pointer/' gcc/Makefile.in.tmp \
       build. Do not forget to apply it.</para>
     </important>
 
+    <para>Usetting the multlib spec for GCC ensures that it
+    won't attempt to link against libraries on the host:</para>
+
+<screen><userinput>cp gcc/config/i386/t-linux64{,.tmp}
+sed '/MULTILIB_OSDIRNAMES/d' gcc/config/i386/t-linux64.tmp \
+  > gcc/config/i386/t-linux64</userinput></screen>
+
     <para>Create a separate build directory again:</para>
 
 <screen><userinput>mkdir -v ../gcc-build
@@ -199,11 +206,6 @@ cd ../gcc-build</userinput></screen>
 
 <screen><userinput>make install</userinput></screen>
 
-    <para>Since we're not building a multilib system, let's move some
-	installed libraries to a more generic location:</para>
-<screen><userinput>cp -va /tools/lib64/* /tools/lib
-rm -rvf /tools/lib64</userinput></screen>
-
     <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
     href="adjusting.xml"
     xpointer="xpointer(/sect1/caution[1])"/>

+ 1 - 1
chapter06/binutils.xml

@@ -59,7 +59,7 @@ cd ../binutils-build</userinput></screen>
     <para>Prepare Binutils for compilation:</para>
 
 <screen><userinput>../binutils-&binutils-version;/configure --prefix=/usr \
-    --enable-shared --disable-multilib</userinput></screen>
+    --enable-shared</userinput></screen>
 
     <para>Compile the package:</para>
 

+ 5 - 6
chapter06/gcc.xml

@@ -35,11 +35,6 @@
   <sect2 role="installation">
     <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
     installation of <filename class="libraryfile">libiberty.a</filename>. The
     version of <filename class="libraryfile">libiberty.a</filename> provided by
@@ -190,7 +185,11 @@ cd ../gcc-build</userinput></screen>
     href="readjusting.xml"
     xpointer="xpointer(//*[@os='k'])"/>
 
-<screen><computeroutput>SEARCH_DIR("/usr/x86_64-unknown-linux-gnu/lib")
+<screen><computeroutput>SEARCH_DIR("/usr/x86_64-unknown-linux-gnu/lib64")
+SEARCH_DIR("/usr/local/lib64")
+SEARCH_DIR("/lib64")
+SEARCH_DIR("/usr/lib64")
+SEARCH_DIR("/usr/x86_64-unknown-linux-gnu/lib")
 SEARCH_DIR("/usr/local/lib")
 SEARCH_DIR("/lib")
 SEARCH_DIR("/usr/lib");</computeroutput></screen>

+ 1 - 6
chapter06/glibc.xml

@@ -101,16 +101,11 @@ mv glibc-libidn-&glibc-version; libidn</userinput></screen>
 <screen><userinput>mkdir -v ../glibc-build
 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>
 
 <screen><userinput>../glibc-&glibc-version;/configure --prefix=/usr \
     --disable-profile --enable-add-ons \
-    --enable-kernel=2.6.0 --libexecdir=/usr/lib/glibc \
-    --libdir=/usr/lib</userinput></screen>
+    --enable-kernel=2.6.0 --libexecdir=/usr/lib/glibc</userinput></screen>
 
     <variablelist>
       <title>The meaning of the new configure options:</title>

+ 3 - 3
chapter06/readjusting.xml

@@ -46,7 +46,7 @@ ln -sv /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld</userinput></screen>
   </important>
 
 <screen><userinput>gcc -dumpspecs | sed \
-    -e 's@/tools/lib/ld-linux-x86-64.so.2@/lib/ld-linux-x86-64.so.2@g' \
+    -e 's@/tools/lib64/ld-linux-x86-64.so.2@/lib64/ld-linux-x86-64.so.2@g' \
     -e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \
     -e '/\*cpp:/{n;s@$@ -isystem /usr/include@}' &gt; \
     `dirname $(gcc --print-libgcc-file-name)`/specs</userinput></screen>
@@ -105,12 +105,12 @@ SEARCH_DIR("/lib");</computeroutput></screen>
 
   <para os="l">Next make sure that we're using the correct libc:</para>
 
-<screen os="m"><userinput>grep "/lib/libc.so.6 " dummy.log</userinput></screen>
+<screen os="m"><userinput>grep "/lib64/libc.so.6 " dummy.log</userinput></screen>
 
   <para os="n">If everything is working correctly, there should be no errors,
   and the output of the last command will be:</para>
 
-<screen os="o"><computeroutput>attempt to open /lib/libc.so.6 succeeded</computeroutput></screen>
+<screen os="o"><computeroutput>attempt to open /lib64/libc.so.6 succeeded</computeroutput></screen>
 
   <para os="p">Lastly, make sure GCC is using the correct dynamic linker:</para>
 

+ 3 - 7
patches.ent

@@ -43,13 +43,9 @@
 <!ENTITY gawk-segfault-patch-md5 "7679530d88bf3eb56c42eb6aba342ddb">
 <!ENTITY gawk-segfault-patch-size "1.3 KB">
 
-<!ENTITY gcc-pure64-patch "gcc-&gcc-version;-pure64-1.patch">
-<!ENTITY gcc-pure64-patch-md5 "cea9bf46663392d627de81e2456698e3">
-<!ENTITY gcc-pure64-patch-size "6.7 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 gcc-specs-patch "gcc-&gcc-version;-specs-1.patch">
+<!ENTITY gcc-specs-patch-md5 "a17be8ccfb978e73f382be5093dd8abd">
+<!ENTITY gcc-specs-patch-size "14.8 KB">
 
 <!ENTITY glibc-branch_update-patch "glibc-&glibc-version;-branch_update-3.patch">
 <!ENTITY glibc-branch_update-patch-md5 "cbad3863a39eed9e52af083c5035f283">