r1166 - in trunk/BOOK: chapter01 chapter05 chapter06

robert at linuxfromscratch.org robert at linuxfromscratch.org
Sat Jun 16 09:54:40 PDT 2007


Author: robert
Date: 2007-06-16 10:54:40 -0600 (Sat, 16 Jun 2007)
New Revision: 1166

Modified:
   trunk/BOOK/chapter01/changelog.xml
   trunk/BOOK/chapter05/cocoon-toolchain.xml
   trunk/BOOK/chapter06/butterfly-toolchain.xml
Log:
Symlink GCC's include/ssp/*.h to ../, so that GCC will find and use them automatically with _FORTIFY_SOURCE, for uClibc

Modified: trunk/BOOK/chapter01/changelog.xml
===================================================================
--- trunk/BOOK/chapter01/changelog.xml	2007-06-16 12:52:08 UTC (rev 1165)
+++ trunk/BOOK/chapter01/changelog.xml	2007-06-16 16:54:40 UTC (rev 1166)
@@ -52,6 +52,11 @@
       <para>June 16th, 2007</para>
       <itemizedlist>
         <listitem>
+          <para>[robert]: Symlink GCC's include/ssp/*.h to ../, so that GCC
+          will find and use them automatically with _FORTIFY_SOURCE, for
+          uClibc.</para>
+        </listitem>
+        <listitem>
           <para>[robert]: Clairify and explain why we need -fpic in the first
           toolchain.</para>
         </listitem>

Modified: trunk/BOOK/chapter05/cocoon-toolchain.xml
===================================================================
--- trunk/BOOK/chapter05/cocoon-toolchain.xml	2007-06-16 12:52:08 UTC (rev 1165)
+++ trunk/BOOK/chapter05/cocoon-toolchain.xml	2007-06-16 16:54:40 UTC (rev 1166)
@@ -336,6 +336,22 @@
 
 <screen><userinput>make install</userinput></screen>
 
+    <para condition="uclibc">Make some symbolic links to use the
+    <filename class="libraryfile">libssp</filename> headers so _FORTIFY_SOURCE
+    will work with the redefined function prototypes:</para>
+
+<screen condition="uclibc"><userinput>ln -vs ssp/{ssp,stdio,string,unistd}.h \
+    `dirname $(gcc -print-libgcc-file-name)`/include/</userinput></screen> 
+
+    <para condition="uclibc">You may notice we get a linker warning every time
+    we link to <filename class="libraryfile">libssp.so</filename> because this
+    library contains the <function>gets</function> function.
+    <filename class="libraryfile">libssp.so</filename> contains the
+    <function>gets</function> function in order to protect it, so these
+    warnings can be ignored, and there's no practical way of preventing the
+    warnings.</para>
+<!-- Note: check how Glibc avoids this linker warning. -->
+
     <important>
       <para>Confirm the new compiler is defining PIC, SSP, FORTIFY_SOURCE,
       and OPTIMIZE:</para>

Modified: trunk/BOOK/chapter06/butterfly-toolchain.xml
===================================================================
--- trunk/BOOK/chapter06/butterfly-toolchain.xml	2007-06-16 12:52:08 UTC (rev 1165)
+++ trunk/BOOK/chapter06/butterfly-toolchain.xml	2007-06-16 16:54:40 UTC (rev 1166)
@@ -202,6 +202,14 @@
 
 <screen><userinput>make tooldir=/usr install</userinput></screen>
 
+    <para condition="uclibc">Make symlinks for _FORTIFY_SOURCE headers. These
+    headers are only used if _FORTIFY_SOURCE is defined, so if you use
+    <option>-U_FORTIFY_SOURCE</option> you will get vanilla behaviour like
+    normal:</para>
+
+<screen condition="uclibc"><userinput>ln -vs ssp/{ssp,stdio,string,unistd}.h \
+    `dirname $(gcc -print-libgcc-file-name)`/include/</userinput></screen>
+
     <para>If you plan to link suid packages to
     <filename class="libraryfile">libmudflap</filename> then you need to move the
     mudflap libraries to <filename class="directory">/lib</filename> with the




More information about the hlfs-book mailing list