Author: robert
Date: 2007-04-07 03:16:40 -0600 (Sat, 07 Apr 2007)
New Revision: 1066
Modified:
trunk/BOOK/chapter01/changelog.xml
trunk/BOOK/chapter05/cocoon-toolchain.xml
trunk/BOOK/general.ent
trunk/BOOK/prologue/bookinfo.xml
Log:
Reverse last commit. uClibc does not support _FORTIFY_SOURCE, but gcc and
libssp do (it works).
Modified: trunk/BOOK/chapter01/changelog.xml
===================================================================
--- trunk/BOOK/chapter01/changelog.xml 2007-04-06 02:35:10 UTC (rev 1065)
+++ trunk/BOOK/chapter01/changelog.xml 2007-04-07 09:16:40 UTC (rev 1066)
@@ -107,9 +107,6 @@
</listitem>
-->
-<listitem><para>April 5th, 2007 [Robert]: uClibc does not support
--D_FORTIFY_SOURCE.</para></listitem>
-
<listitem><para>April 4rth, 2007 [Robert]: Added gcc-uClibc_conf and
gcc-uClibc_locale patches. I don't think the gcc-uClibc_libstdc patch is
needed because all it does is add -fPIC, and we do that ourselves. Various
Modified: trunk/BOOK/chapter05/cocoon-toolchain.xml
===================================================================
--- trunk/BOOK/chapter05/cocoon-toolchain.xml 2007-04-06 02:35:10 UTC (rev
1065)
+++ trunk/BOOK/chapter05/cocoon-toolchain.xml 2007-04-07 09:16:40 UTC (rev
1066)
@@ -168,7 +168,7 @@
</listitem>
</varlistentry>
- <varlistentry condition="glibc">
+ <varlistentry>
<term><parameter><option>-D_FORTIFY_SOURCE=0</option></parameter></term>
<listitem>
<para>This will disable '<command>ccp</command>
<option>-D_FORTIFY_SOURCE=2</option>'.
@@ -177,7 +177,7 @@
</listitem>
</varlistentry>
- <varlistentry condition="glibc">
+ <varlistentry>
<term><parameter><option>-O0</option></parameter></term>
<listitem>
<para>This will disable '<command>gcc</command> <option>-O</option>'
@@ -226,7 +226,7 @@
<para>The following file redefines GCC's default behaviour to add various
options:</para>
-<screen condition="glibc"><userinput><literal>echo '#ifndef HARDENED_SPECS_H
+<screen><userinput><literal>echo '#ifndef HARDENED_SPECS_H
#define HARDENED_SPECS_H
#if defined(__i386__) && defined(__linux__) &&
defined(__ELF__) \
@@ -277,54 +277,6 @@
#endif /* __i386__ && __linux__ && __ELF__ &&
HAVE_LD_PIE */
#endif /* HARDENED_SPECS_H */' >
gcc/hardened-specs.h</literal></userinput></screen>
-<!-- uClibc does not support -D_FORTIFY_SOURCE* -->
-<screen condition="uclibc"><userinput><literal>echo '#ifndef HARDENED_SPECS_H
-#define HARDENED_SPECS_H
-
-#if defined(__i386__) && defined(__linux__) &&
defined(__ELF__) \
- && defined(HAVE_LD_PIE) &&
defined(TARGET_LIBC_PROVIDES_SSP)
-
-#undef CC1_SPEC
-#define CC1_SPEC "%(cc1_cpu) %{profile:-p} \
- %{D__KERNEL__|fpic|fPIC|fpie|fPIE|fno-pic|fno-PIC \
- :;shared|nostdlib|nostartfiles:-fPIC} \
- %{static|D__KERNEL__|fpic|fPIC|fpie|fPIE|fno-pie|fno-PIE| \
- shared|nostdlib|nostartfiles:;:-fPIE} \
- %{D__KERNEL__|fno-stack-protector|fstack-protector| \
- fstack-protector-all:;D_LIBC_REENTRANT:-fstack-protector;: \
- -fstack-protector-all}"
-
-#undef CC1PLUS_SPEC
-#define CC1PLUS_SPEC \
- "%{D__KERNEL__|fpic|fPIC|fpie|fPIE|fno-pic|fno-PIC \
- :;shared|nostdlib|nostartfiles:-fPIC} \
- %{static|D__KERNEL__|fpic|fPIC|fpie|fPIE|fno-pie|fno-PIE| \
- shared|nostdlib|nostartfiles:;:-fPIE} \
- %{D__KERNEL__|fno-stack-protector|fstack-protector| \
- fstack-protector-all:;D_LIBC_REENTRANT:-fstack-protector;: \
- -fstack-protector-all}"
-
-#undef ENDFILE_SPEC
-#define ENDFILE_SPEC "%{ffast-math|funsafe-math-optimizations: \
- crtfastmath.o%s} \
- %{static|nopie:crtend.o%s;:crtendS.o%s} crtn.o%s"
-
-#undef STARTFILE_SPEC
-#define STARTFILE_SPEC "%{shared:;pg|p|profile:gcrt1.o%s; \
- static|nopie:crt1.o%s;:Scrt1.o%s} crti.o%s \
- %{static:crtbeginT.o%s;nopie:crtbegin.o%s;:crtbeginS.o%s}"
-
-#undef LINK_PIE_SPEC
-#define LINK_PIE_SPEC "%{pie:-pie} %{!static:%{!Bstatic: \
- %{nonow:-z lazy;:-z now} %{norelro:-z norelro;:-z relro} \
- %{nocombreloc:-z nocombreloc;:-z combreloc} \
- %{shared|Bshareable|i|r|pie|nopie:;:-pie}}}"
-
-#else /* __i386__ && __linux__ && __ELF__ &&
HAVE_LD_PIE */
-#error "You are using an unsupported system. This header can not be used."
-#endif /* __i386__ && __linux__ && __ELF__ &&
HAVE_LD_PIE */
-#endif /* HARDENED_SPECS_H */' >
gcc/hardened-specs.h</literal></userinput></screen>
-
<para>This command includes the hardened-specs header in the right
place:</para>
<screen><userinput>cp -vi gcc/gcc.c{,.orig}
@@ -537,35 +489,25 @@
<screen><userinput>make install</userinput></screen>
-<important>
- <para condition="glibc">Confirm the new compiler is defining PIC, SSP,
- FORTIFY_SOURCE, and OPTIMIZE:</para>
+<important><para>Confirm the new compiler is defining PIC, SSP, FORTIFY_SOURCE,
+and OPTIMIZE:</para>
- <para condition="uclibc">Confirm the new compiler is defining PIC, and
- SSP:</para>
+<screen><userinput>echo | cc -dM -E - | grep -E
'PIC|SSP|FORTIFY|OPTIMIZE'</userinput></screen>
-<screen condition="glibc"><userinput>echo | cc -dM -E - | grep -E
'PIC|SSP|FORTIFY|OPTIMIZE'</userinput></screen>
+<para>This should return:</para>
-<screen condition="uclibc"><userinput>echo | cc -dM -E - | grep -E
'PIC|SSP'</userinput></screen>
-
- <para>This should return:</para>
-
-<screen condition="glibc"><computeroutput>#define __OPTIMIZE__ 1
+<screen><computeroutput>#define __OPTIMIZE__ 1
#define _FORTIFY_SOURCE 2
#define __SSP_ALL__ 2
#define __PIC__ 1</computeroutput></screen>
-<screen condition="uclibc"><computeroutput>#define __SSP_ALL__ 2
-#define __PIC__ 1</computeroutput></screen>
+<para>Otherwise something went wrong and you should verify libc was installed
+to <filename class="directory">/tools/lib</filename>, and reinstall it and this
+toolchain.</para></important>
- <para>Otherwise something went wrong and you should verify libc was
- installed to <filename class="directory">/tools/lib</filename>,
- and reinstall it and this toolchain.</para>
-</important>
+<para>Next, prepare the linker for the <quote>Re-adjusting</quote> phase
+in the next chapter:</para>
- <para>Next, prepare the linker for the <quote>Re-adjusting</quote> phase
- in the next chapter:</para>
-
<screen><userinput>make -C ld clean
make -C ld LIB_PATH=/usr/lib:/lib
make -C ld EXEEXT=-new install-exec-local</userinput></screen>
Modified: trunk/BOOK/general.ent
===================================================================
--- trunk/BOOK/general.ent 2007-04-06 02:35:10 UTC (rev 1065)
+++ trunk/BOOK/general.ent 2007-04-07 09:16:40 UTC (rev 1066)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
-<!ENTITY version "SVN-20070405">
-<!ENTITY releasedate "April 5th, 2007">
+<!ENTITY version "SVN-20070404">
+<!ENTITY releasedate "April 4rth, 2007">
<!ENTITY milestone "1.1">
<!ENTITY lfs-root "http://www.linuxfromscratch.org/">
Modified: trunk/BOOK/prologue/bookinfo.xml
===================================================================
--- trunk/BOOK/prologue/bookinfo.xml 2007-04-06 02:35:10 UTC (rev 1065)
+++ trunk/BOOK/prologue/bookinfo.xml 2007-04-07 09:16:40 UTC (rev 1066)
@@ -49,9 +49,7 @@
of Bintuils and is utilized by Glibc and uClibc: <ulink
url="http://sources.redhat.com/ml/binutils/2004-01/msg00070.html"/></para></listitem>
<listitem><para>FORTIFY_SOURCE runtime buffer overflow protection: <ulink
-url="http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html"/>. This is
-currently only supported with Glibc.</para></listitem>
-
+url="http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html"/></para></listitem>
<listitem><para>Heap Consistency Checking in Glibc: <ulink
url="http://www.gnu.org/software/libc/manual/html_node/Heap-Consistency-Checking.html"/></para></listitem>
<listitem><para>strlcpy() strlcat() C library functions: <ulink
--
http://linuxfromscratch.org/mailman/listinfo/hlfs-book
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page