Author: dnicholson
Date: 2007-03-23 15:05:26 -0600 (Fri, 23 Mar 2007)
New Revision: 7972

Modified:
   trunk/BOOK/chapter01/changelog.xml
   trunk/BOOK/chapter06/gcc.xml
   trunk/BOOK/chapter06/readjusting.xml
Log:
Readjust the gcc header search path to include /usr/include and test it


Modified: trunk/BOOK/chapter01/changelog.xml
===================================================================
--- trunk/BOOK/chapter01/changelog.xml  2007-03-23 20:26:13 UTC (rev 7971)
+++ trunk/BOOK/chapter01/changelog.xml  2007-03-23 21:05:26 UTC (rev 7972)
@@ -40,6 +40,12 @@
       <para>2007-03-23</para>
       <itemizedlist>
         <listitem>
+          <para>[dnicholson] - When readjusting the GCC specs file, ensure
+          that GCC will search for the system headers in /usr/include. An
+          addition to the toolchain sanity checks has been made to test
+          this. This fix originates from DIY Linux.</para>
+        </listitem>
+        <listitem>
           <para>[dnicholson] - Included the branch update patch for the
           temporary Glibc in Chapter 5 to help minimize differences with the
           final Glibc.</para>

Modified: trunk/BOOK/chapter06/gcc.xml
===================================================================
--- trunk/BOOK/chapter06/gcc.xml        2007-03-23 20:26:13 UTC (rev 7971)
+++ trunk/BOOK/chapter06/gcc.xml        2007-03-23 21:05:26 UTC (rev 7972)
@@ -161,19 +161,20 @@
     href="readjusting.xml"
     xpointer="xpointer(//[EMAIL PROTECTED]'g'])"/>
 
+<screen role="nodump"><userinput>grep -B2 '^ /usr/include' 
dummy.log</userinput></screen>
+
     <xi:include xmlns:xi="http://www.w3.org/2003/XInclude";
     href="readjusting.xml"
     xpointer="xpointer(//[EMAIL PROTECTED]'h'])"/>
 
+<screen><computeroutput>#include &lt;...&gt; search starts here:
+ /usr/lib/gcc/i686-pc-linux-gnu/&gcc-version;/include
+ /usr/include</computeroutput></screen>
+
     <xi:include xmlns:xi="http://www.w3.org/2003/XInclude";
     href="readjusting.xml"
     xpointer="xpointer(//[EMAIL PROTECTED]'i'])"/>
 
-<screen><computeroutput>SEARCH_DIR("/usr/i686-pc-linux-gnu/lib")
-SEARCH_DIR("/usr/local/lib")
-SEARCH_DIR("/lib")
-SEARCH_DIR("/usr/lib");</computeroutput></screen>
-
     <xi:include xmlns:xi="http://www.w3.org/2003/XInclude";
     href="readjusting.xml"
     xpointer="xpointer(//[EMAIL PROTECTED]'j'])"/>
@@ -182,6 +183,11 @@
     href="readjusting.xml"
     xpointer="xpointer(//[EMAIL PROTECTED]'k'])"/>
 
+<screen><computeroutput>SEARCH_DIR("/usr/i686-pc-linux-gnu/lib")
+SEARCH_DIR("/usr/local/lib")
+SEARCH_DIR("/lib")
+SEARCH_DIR("/usr/lib");</computeroutput></screen>
+
     <xi:include xmlns:xi="http://www.w3.org/2003/XInclude";
     href="readjusting.xml"
     xpointer="xpointer(//[EMAIL PROTECTED]'l'])"/>
@@ -218,6 +224,14 @@
     href="readjusting.xml"
     xpointer="xpointer(//[EMAIL PROTECTED]'t'])"/>
 
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude";
+    href="readjusting.xml"
+    xpointer="xpointer(//[EMAIL PROTECTED]'u'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude";
+    href="readjusting.xml"
+    xpointer="xpointer(//[EMAIL PROTECTED]'v'])"/>
+
   </sect2>
 
   <sect2 id="contents-gcc" role="content">

Modified: trunk/BOOK/chapter06/readjusting.xml
===================================================================
--- trunk/BOOK/chapter06/readjusting.xml        2007-03-23 20:26:13 UTC (rev 
7971)
+++ trunk/BOOK/chapter06/readjusting.xml        2007-03-23 21:05:26 UTC (rev 
7972)
@@ -44,9 +44,10 @@
     linkend="ch-tools-toolchaintechnotes" role=","/> if necessary.</para>
   </important>
 
-<screen><userinput>gcc -dumpspecs | \
-perl -p -e 's@/tools/lib/ld-linux.so.2@/lib/[EMAIL PROTECTED];' \
-    -e '[EMAIL PROTECTED]:[EMAIL PROTECTED]/usr/lib/ @g;' &gt; \
+<screen><userinput>gcc -dumpspecs | sed \
+    -e 's@/tools/lib/ld-linux.so.2@/lib/[EMAIL PROTECTED]' \
+    -e '/\*startfile_prefix_spec:/{n;[EMAIL PROTECTED]@/usr/lib/ @}' \
+    -e '/\*cpp:/{n;[EMAIL PROTECTED]@ -isystem /usr/[EMAIL PROTECTED]' &gt; \
     `dirname $(gcc --print-libgcc-file-name)`/specs</userinput></screen>
 
   <para>It is a good idea to visually inspect the specs file to verify the
@@ -57,7 +58,7 @@
   as expected. To do this, perform the following sanity checks:</para>
 
 <screen role="nodump" os="a"><userinput>echo 'main(){}' &gt; dummy.c
-cc dummy.c -Wl,--verbose &amp;&gt; dummy.log
+cc dummy.c -v -Wl,--verbose &amp;&gt; dummy.log
 readelf -l a.out | grep ': /lib'</userinput></screen>
 
   <para os="b">If everything is working correctly, there should be no errors,
@@ -80,44 +81,54 @@
 /usr/lib/crti.o succeeded
 /usr/lib/crtn.o succeeded</computeroutput></screen>
 
-  <para os="g">Next, verify that the new linker is being used with the correct 
search paths:</para>
+  <para os="g">Verify that the compiler is searching for the correct header
+  files:</para>
 
-<screen role="nodump" os="h"><userinput>grep 'SEARCH.*/usr/lib' dummy.log |sed 
's|; |\n|g'</userinput></screen>
+<screen role="nodump"><userinput>grep -B1 '^ /usr/include' 
dummy.log</userinput></screen>
 
-  <para os="i">If everything is working correctly, there should be no errors,
+  <para os="h">This command should return successfully with the following 
output:</para>
+
+<screen><computeroutput>#include &lt;...&gt; search starts here:
+ /usr/include</computeroutput></screen>
+
+  <para os="i">Next, verify that the new linker is being used with the correct 
search paths:</para>
+
+<screen role="nodump" os="j"><userinput>grep 'SEARCH.*/usr/lib' dummy.log |sed 
's|; |\n|g'</userinput></screen>
+
+  <para os="k">If everything is working correctly, there should be no errors,
   and the output of the last command will be:</para>
 
 <screen><computeroutput>SEARCH_DIR("/tools/i686-pc-linux-gnu/lib")
 SEARCH_DIR("/usr/lib")
 SEARCH_DIR("/lib");</computeroutput></screen>
 
-  <para os="j">Next make sure that we're using the correct libc:</para>
+  <para os="l">Next make sure that we're using the correct libc:</para>
 
-<screen role="nodump" os="k"><userinput>grep "/lib/libc.so.6 " 
dummy.log</userinput></screen>
+<screen role="nodump" os="m"><userinput>grep "/lib/libc.so.6 " 
dummy.log</userinput></screen>
 
-  <para os="l">If everything is working correctly, there should be no errors,
+  <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="m"><computeroutput>attempt to open /lib/libc.so.6 
succeeded</computeroutput></screen>
+<screen os="o"><computeroutput>attempt to open /lib/libc.so.6 
succeeded</computeroutput></screen>
 
-  <para os="n">Lastly, make sure GCC is using the correct dynamic 
linker:</para>
+  <para os="p">Lastly, make sure GCC is using the correct dynamic 
linker:</para>
 
-<screen role="nodump" os="o"><userinput>grep found 
dummy.log</userinput></screen>
+<screen role="nodump" os="q"><userinput>grep found 
dummy.log</userinput></screen>
 
-  <para os="p">If everything is working correctly, there should be no errors,
+  <para os="r">If everything is working correctly, there should be no errors,
   and the output of the last command will be (allowing for
   platform-specific differences in dynamic linker name):</para>
 
-<screen os="q"><computeroutput>found ld-linux.so.2 at 
/lib/ld-linux.so.2</computeroutput></screen>
+<screen os="s"><computeroutput>found ld-linux.so.2 at 
/lib/ld-linux.so.2</computeroutput></screen>
 
-  <para os="r">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
   steps to find out where the problem is and correct it. The most likely
   reason is that something went wrong with the specs file adjustment. Any
   issues will need to be resolved before continuing on with the process.</para>
 
-  <para os="s">Once everything is working correctly, clean up the test 
files:</para>
+  <para os="u">Once everything is working correctly, clean up the test 
files:</para>
 
-<screen role="nodump" os="t"><userinput>rm -v dummy.c a.out 
dummy.log</userinput></screen>
+<screen role="nodump" os="v"><userinput>rm -v dummy.c a.out 
dummy.log</userinput></screen>
 
 </sect1>

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