Author: jhuntwork
Date: 2007-08-30 11:34:55 -0600 (Thu, 30 Aug 2007)
New Revision: 8349

Modified:
   branches/jh/BOOK/chapter01/changelog.xml
   branches/jh/BOOK/chapter05/binutils-pass1.xml
   branches/jh/BOOK/chapter05/gcc-pass1.xml
   branches/jh/BOOK/chapter05/gcc-pass2.xml
   branches/jh/BOOK/chapter06/gcc.xml
Log:
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.

Modified: branches/jh/BOOK/chapter01/changelog.xml
===================================================================
--- branches/jh/BOOK/chapter01/changelog.xml    2007-08-30 04:18:29 UTC (rev 
8348)
+++ branches/jh/BOOK/chapter01/changelog.xml    2007-08-30 17:34:55 UTC (rev 
8349)
@@ -37,6 +37,16 @@
 -->
 
     <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>
       <para>2007-08-20</para>
       <itemizedlist>
         <listitem>

Modified: branches/jh/BOOK/chapter05/binutils-pass1.xml
===================================================================
--- branches/jh/BOOK/chapter05/binutils-pass1.xml       2007-08-30 04:18:29 UTC 
(rev 8348)
+++ branches/jh/BOOK/chapter05/binutils-pass1.xml       2007-08-30 17:34:55 UTC 
(rev 8349)
@@ -57,10 +57,16 @@
       &amp;&amp; make install; }</userinput>.</para>
     </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>
 
-<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>
       <title>The meaning of the configure options:</title>
@@ -113,21 +119,22 @@
     tests at this point are minimal since the programs from this
     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>
 
 <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>
 
 <screen><userinput>make -C ld clean
 make -C ld LIB_PATH=/tools/lib
 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>
       <title>The meaning of the make parameters:</title>
 

Modified: branches/jh/BOOK/chapter05/gcc-pass1.xml
===================================================================
--- branches/jh/BOOK/chapter05/gcc-pass1.xml    2007-08-30 04:18:29 UTC (rev 
8348)
+++ branches/jh/BOOK/chapter05/gcc-pass1.xml    2007-08-30 17:34:55 UTC (rev 
8349)
@@ -43,11 +43,22 @@
 <screen><userinput>mkdir -v ../gcc-build
 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>
 
-<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 \
-    --enable-languages=c --disable-multilib 
--with-arch=i486</userinput></screen>
+    --enable-languages=c --disable-multilib \
+    $WITHARCH
+unset M64 WITHARCH</userinput></screen>
 
     <variablelist>
       <title>The meaning of the configure options:</title>
@@ -109,25 +120,8 @@
 
     <para>Continue with compiling the package:</para>
 
-<screen><userinput>make bootstrap</userinput></screen>
+<screen><userinput>make</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>
-
     <para>Compilation is now complete. At this point, the test suite would
     normally be run, but, as mentioned before, the test suite framework is
     not in place yet. The benefits of running the tests at this point

Modified: branches/jh/BOOK/chapter05/gcc-pass2.xml
===================================================================
--- branches/jh/BOOK/chapter05/gcc-pass2.xml    2007-08-30 04:18:29 UTC (rev 
8348)
+++ branches/jh/BOOK/chapter05/gcc-pass2.xml    2007-08-30 17:34:55 UTC (rev 
8349)
@@ -134,6 +134,12 @@
     <para>Before starting to build GCC, remember to unset any environment
     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>
 
 <screen><userinput>../gcc-&gcc-version;/configure --prefix=/tools \
@@ -141,7 +147,8 @@
     --enable-shared --enable-threads=posix \
     --enable-__cxa_atexit --enable-languages=c,c++ \
     --disable-libstdcxx-pch --disable-multilib \
-    --with-arch=i486</userinput></screen>
+    $WITHARCH
+unset WITHARCH</userinput></screen>
 
     <variablelist>
       <title>The meaning of the new configure options:</title>

Modified: branches/jh/BOOK/chapter06/gcc.xml
===================================================================
--- branches/jh/BOOK/chapter06/gcc.xml  2007-08-30 04:18:29 UTC (rev 8348)
+++ branches/jh/BOOK/chapter06/gcc.xml  2007-08-30 17:34:55 UTC (rev 8349)
@@ -72,13 +72,20 @@
 <screen><userinput>mkdir -v ../gcc-build
 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>
 
 <screen><userinput>../gcc-&gcc-version;/configure --prefix=/usr \
     --libexecdir=/usr/lib --enable-shared \
     --enable-threads=posix --enable-__cxa_atexit \
     --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>
 

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-book
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page

Reply via email to