Author: jhuntwork
Date: 2012-04-22 15:12:29 -0600 (Sun, 22 Apr 2012)
New Revision: 9818

Modified:
   branches/jh/chapter01/changelog.xml
   branches/jh/chapter05/gcc-pass1.xml
   branches/jh/chapter05/gcc-pass2.xml
Log:
Add --with-native-system-header-dir switch to gcc pass1 and pass2. Also remove 
--without-cloog and --without-ppl from gcc pass2 as it is unnecessary there.

Modified: branches/jh/chapter01/changelog.xml
===================================================================
--- branches/jh/chapter01/changelog.xml 2012-04-22 21:00:23 UTC (rev 9817)
+++ branches/jh/chapter01/changelog.xml 2012-04-22 21:12:29 UTC (rev 9818)
@@ -37,6 +37,23 @@
 
 -->
     <listitem>
+      <para>2012-04-22</para>
+      <itemizedlist>
+        <listitem>
+          <para>[jhuntwork] - Use --with-native-system-header-dir switch in 
chapter 5 gcc.
+          This replaces seds that were used previously to alter the 
CROSS_SYSTEM_HEADER_DIR
+          and NATIVE_SYSTEM_HEADER_DIR values to keep the toolchain searching 
for headers
+          only in /tools/include and not /usr/include. Thanks to Pierre 
Labastie.</para>
+        </listitem>
+        <listitem>
+          <para>[jhuntwork] - Remove --without-cloog and --without-ppl from 
gcc pass2.
+          These are unecessary since pass 1 gcc shouldn't be able to find and 
link to
+          them when installed on the host system anyway.</para>
+        </listitem>
+      </itemizedlist>
+    </listitem>
+
+    <listitem>
       <para>2012-04-19</para>
       <itemizedlist>
          <listitem>

Modified: branches/jh/chapter05/gcc-pass1.xml
===================================================================
--- branches/jh/chapter05/gcc-pass1.xml 2012-04-22 21:00:23 UTC (rev 9817)
+++ branches/jh/chapter05/gcc-pass1.xml 2012-04-22 21:12:29 UTC (rev 9818)
@@ -100,12 +100,6 @@
     changes to the original files in case the commands are inadvertently run 
twice.
     </para> 
  
-    <para>Set the location GCC will search for its system headers:</para>
-
-<screen><userinput remap="pre">cp gcc/Makefile.in{,.orig}
-sed '/^CROSS_SYSTEM_HEADER_DIR/s@= .*@= /tools/include@' \
-    gcc/Makefile.in.orig &gt; gcc/Makefile.in</userinput></screen>
-
     <para>The GCC documentation recommends building GCC outside of the
     source directory in a dedicated build directory:</para>
 
@@ -121,6 +115,7 @@
     --with-newlib              \
     --without-headers          \
     --with-local-prefix=/tools \
+    --with-native-system-header-dir=/tools/include \
     --disable-nls              \
     --disable-shared           \
     --disable-multilib         \
@@ -169,6 +164,18 @@
        </varlistentry>
  
        <varlistentry>
+         
<term><parameter>--with-native-system-header-dir=/tools/include</parameter></term>
+         <listitem>
+           <para>By default GCC searches <filename>/usr/include</filename> for 
system
+           headers. In conjunction with the sysroot switch, this would 
translate normally
+           to <filename>$LFS/usr/include</filename>. However the headers that 
will be installed
+           in the next two sections will go to 
<filename>$LFS/tools/include</filename>. This
+           switch ensures that gcc will find them correctly. In the second 
pass of GCC, this
+           same switch will ensure that no headers from the host system are 
found.</para>
+         </listitem>
+       </varlistentry>
+
+       <varlistentry>
         <term><parameter>--disable-shared</parameter></term>
         <listitem>
           <para>This switch forces GCC to link its internal libraries

Modified: branches/jh/chapter05/gcc-pass2.xml
===================================================================
--- branches/jh/chapter05/gcc-pass2.xml 2012-04-22 21:00:23 UTC (rev 9817)
+++ branches/jh/chapter05/gcc-pass2.xml 2012-04-22 21:12:29 UTC (rev 9818)
@@ -98,12 +98,6 @@
   touch $file.orig
 done</userinput></screen>
 
-    <para>Set the location GCC will search for its system headers:</para>
-
-<screen><userinput remap="pre">cp gcc/Makefile.in{,.bak3}
-sed '/^NATIVE_SYSTEM_HEADER_DIR/s@= .*@= /tools/include@' \
-    gcc/Makefile.in.bak3 &gt; gcc/Makefile.in</userinput></screen>
-
     <para>As in the first build of GCC it requires the GMP, MPFR and MPC
     packages. Unpack the tarballs and move them into the required directory
     names:</para>
@@ -131,6 +125,7 @@
 ../gcc-&gcc-version;/configure  \
     --prefix=/tools             \
     --with-local-prefix=/tools  \
+    --with-native-system-header-dir=/tools/include \
     --enable-clocale=gnu        \
     --enable-shared             \
     --enable-threads=posix      \
@@ -140,8 +135,6 @@
     --disable-multilib          \
     --disable-bootstrap         \
     --disable-libgomp           \
-    --without-ppl               \
-    --without-cloog             \
     --with-mpfr-include=$(pwd)/../gcc-&gcc-version;/mpfr/src \
     --with-mpfr-lib=$(pwd)/mpfr/src/.libs</userinput></screen>
 

-- 
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