浏览代码

Use --with-arch=i486 only for x86. Also force '-m64' for 64-bit builds.
Lastly, use 'make' instead of 'make bootstrap' on gcc pass 1. The bootstrap is now default.

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

Jeremy Huntwork 18 年之前
父节点
当前提交
b8dd57d62b
共有 5 个文件被更改,包括 54 次插入29 次删除
  1. 10 0
      chapter01/changelog.xml
  2. 14 7
      chapter05/binutils-pass1.xml
  3. 14 20
      chapter05/gcc-pass1.xml
  4. 8 1
      chapter05/gcc-pass2.xml
  5. 8 1
      chapter06/gcc.xml

+ 10 - 0
chapter01/changelog.xml

@@ -36,6 +36,16 @@
     </listitem>
     </listitem>
 -->
 -->
 
 
+    <listitem>
+      <para>2007-08-30</para>
+      <itemizedlist>
+        <listitem>
+          <para>[jhuntwork] - Use --with-arch=i486 only for x86. Also force '-m64' for 64-bit builds.
+	  Lastly, use 'make' instead of 'make bootstrap' on gcc pass 1. The bootstrap is now default.</para>
+        </listitem>
+      </itemizedlist>
+    </listitem>
+
     <listitem>
     <listitem>
       <para>2007-08-20</para>
       <para>2007-08-20</para>
       <itemizedlist>
       <itemizedlist>

+ 14 - 7
chapter05/binutils-pass1.xml

@@ -57,10 +57,16 @@ cd ../binutils-build</userinput></screen>
       &amp;&amp; make install; }</userinput>.</para>
       &amp;&amp; make install; }</userinput>.</para>
     </note>
     </note>
 
 
+    <para>If our host is a multilib machine, we want to ensure that we
+    build 64-bit binaries, so we'll test for that and set a variable if so:</para>
+
+<screen><userinput>test $(uname -m | grep 64) &amp;&amp; M64="-m64"</userinput></screen>
+
     <para>Now prepare Binutils for compilation:</para>
     <para>Now prepare Binutils for compilation:</para>
 
 
-<screen><userinput>CC="gcc -B/usr/bin/" ../binutils-&binutils-version;/configure \
-    --prefix=/tools --disable-nls --disable-werror</userinput></screen>
+<screen><userinput>CC="gcc -B/usr/bin/ $M64" ../binutils-&binutils-version;/configure \
+    --prefix=/tools --disable-nls --disable-werror
+unset M64</userinput></screen>
 
 
     <variablelist>
     <variablelist>
       <title>The meaning of the configure options:</title>
       <title>The meaning of the configure options:</title>
@@ -113,21 +119,22 @@ cd ../binutils-build</userinput></screen>
     tests at this point are minimal since the programs from this
     tests at this point are minimal since the programs from this
     first pass will soon be replaced by those from the second.</para>
     first pass will soon be replaced by those from the second.</para>
 
 
+    <para>Create a symlink to ensure the sanity of our toolchain:</para>
+
+<screen><userinput>mkdir -v /tools/lib
+ln -sv lib /tools/lib64</userinput></screen>
+
     <para>Install the package:</para>
     <para>Install the package:</para>
 
 
 <screen><userinput>make install</userinput></screen>
 <screen><userinput>make install</userinput></screen>
 
 
-    <para>Next, prepare the linker for the <quote>Adjusting</quote> phase
+    <para>Finally, prepare the linker for the <quote>Adjusting</quote> phase
     later on:</para>
     later on:</para>
 
 
 <screen><userinput>make -C ld clean
 <screen><userinput>make -C ld clean
 make -C ld LIB_PATH=/tools/lib
 make -C ld LIB_PATH=/tools/lib
 cp -v ld/ld-new /tools/bin</userinput></screen>
 cp -v ld/ld-new /tools/bin</userinput></screen>
 
 
-    <para>Finally, create a symlink to ensure the sanity of our toolchain:</para>
-
-<screen><userinput>ln -nsv lib /tools/lib64</userinput></screen>
-
     <variablelist>
     <variablelist>
       <title>The meaning of the make parameters:</title>
       <title>The meaning of the make parameters:</title>
 
 

+ 14 - 20
chapter05/gcc-pass1.xml

@@ -43,11 +43,22 @@
 <screen><userinput>mkdir -v ../gcc-build
 <screen><userinput>mkdir -v ../gcc-build
 cd ../gcc-build</userinput></screen>
 cd ../gcc-build</userinput></screen>
 
 
+    <para>If our host is a multilib machine, we want to ensure that we
+    build 64-bit binaries, so we'll test for that and set a variable if so.
+    Also, the --with-arch flag is only necessary for x86 machines.</para>
+
+<screen><userinput>case $(uname -m) in
+  x86) WITHARCH="--with-arch=i486" ;;
+  x86_64) M64="-m64" ;;
+esac</userinput></screen>
+
     <para>Prepare GCC for compilation:</para>
     <para>Prepare GCC for compilation:</para>
 
 
-<screen><userinput>CC="gcc -B/usr/bin/" ../gcc-&gcc-version;/configure --prefix=/tools \
+<screen><userinput>CC="gcc -B/usr/bin/ $M64" ../gcc-&gcc-version;/configure --prefix=/tools \
     --with-local-prefix=/tools --disable-nls --disable-shared \
     --with-local-prefix=/tools --disable-nls --disable-shared \
-    --enable-languages=c --disable-multilib --with-arch=i486</userinput></screen>
+    --enable-languages=c --disable-multilib \
+    $WITHARCH
+unset M64 WITHARCH</userinput></screen>
 
 
     <variablelist>
     <variablelist>
       <title>The meaning of the configure options:</title>
       <title>The meaning of the configure options:</title>
@@ -109,24 +120,7 @@ cd ../gcc-build</userinput></screen>
 
 
     <para>Continue with compiling the package:</para>
     <para>Continue with compiling the package:</para>
 
 
-<screen><userinput>make bootstrap</userinput></screen>
-
-    <variablelist>
-      <title>The meaning of the make parameter:</title>
-
-      <varlistentry>
-        <term><parameter>bootstrap</parameter></term>
-        <listitem>
-          <para>This target does not just compile GCC, but compiles it
-          several times. It uses the programs compiled in a first round
-          to compile itself a second time, and then again a third time.
-          It then compares these second and third compiles to make sure
-          it can reproduce itself flawlessly. This also implies that it
-          was compiled correctly.</para>
-        </listitem>
-      </varlistentry>
-
-    </variablelist>
+<screen><userinput>make</userinput></screen>
 
 
     <para>Compilation is now complete. At this point, the test suite would
     <para>Compilation is now complete. At this point, the test suite would
     normally be run, but, as mentioned before, the test suite framework is
     normally be run, but, as mentioned before, the test suite framework is

+ 8 - 1
chapter05/gcc-pass2.xml

@@ -134,6 +134,12 @@ cd ../gcc-build</userinput></screen>
     <para>Before starting to build GCC, remember to unset any environment
     <para>Before starting to build GCC, remember to unset any environment
     variables that override the default optimization flags.</para>
     variables that override the default optimization flags.</para>
 
 
+    <para>The --with-arch flag is only necessary for x86 machines.</para>
+
+<screen><userinput>case $(uname -m) in
+  x86) WITHARCH="--with-arch=i486" ;;
+esac</userinput></screen>
+
     <para>Now prepare GCC for compilation:</para>
     <para>Now prepare GCC for compilation:</para>
 
 
 <screen><userinput>../gcc-&gcc-version;/configure --prefix=/tools \
 <screen><userinput>../gcc-&gcc-version;/configure --prefix=/tools \
@@ -141,7 +147,8 @@ cd ../gcc-build</userinput></screen>
     --enable-shared --enable-threads=posix \
     --enable-shared --enable-threads=posix \
     --enable-__cxa_atexit --enable-languages=c,c++ \
     --enable-__cxa_atexit --enable-languages=c,c++ \
     --disable-libstdcxx-pch --disable-multilib \
     --disable-libstdcxx-pch --disable-multilib \
-    --with-arch=i486</userinput></screen>
+    $WITHARCH
+unset WITHARCH</userinput></screen>
 
 
     <variablelist>
     <variablelist>
       <title>The meaning of the new configure options:</title>
       <title>The meaning of the new configure options:</title>

+ 8 - 1
chapter06/gcc.xml

@@ -72,13 +72,20 @@
 <screen><userinput>mkdir -v ../gcc-build
 <screen><userinput>mkdir -v ../gcc-build
 cd ../gcc-build</userinput></screen>
 cd ../gcc-build</userinput></screen>
 
 
+    <para>The --with-arch flag is only necessary for x86 machines.</para>
+
+<screen><userinput>case $(uname -m) in
+  x86) WITHARCH="--with-arch=i486" ;;
+esac</userinput></screen>
+
     <para>Prepare GCC for compilation:</para>
     <para>Prepare GCC for compilation:</para>
 
 
 <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++ \
     --enable-clocale=gnu --enable-languages=c,c++ \
-    --disable-multilib --with-arch=i486</userinput></screen>
+    --disable-multilib $WITHARCH
+unset WITHARCH</userinput></screen>
 
 
     <para>Compile the package:</para>
     <para>Compile the package:</para>