Index: BOOK/introduction/common/changelog.xml
===================================================================
--- BOOK/introduction/common/changelog.xml	(revision 7c627cb2a57140b55a48ac0990d06d7e75821b92)
+++ BOOK/introduction/common/changelog.xml	(revision ecd738705ca20828083d88ef1d47d14dcd6e26d6)
@@ -40,4 +40,7 @@
       <para>July 11, 2009</para>
       <itemizedlist>
+        <listitem>
+          <para>[jciccone] - Updated the ZLib -fPIC patch to -2.</para>
+        </listitem>
         <listitem>
           <para>[jciccone] - Updated Automake to 1.11.</para>
Index: BOOK/patches.ent
===================================================================
--- BOOK/patches.ent	(revision 7c627cb2a57140b55a48ac0990d06d7e75821b92)
+++ BOOK/patches.ent	(revision ecd738705ca20828083d88ef1d47d14dcd6e26d6)
@@ -105,5 +105,5 @@
 <!ENTITY vim-branch_update-patch-size "636 KB">
 
-<!ENTITY zlib-fpic-patch "zlib-&zlib-version;-fPIC-1.patch">
-<!ENTITY zlib-fpic-patch-md5 "545d60b20bfde6f53023de44438cef59">
+<!ENTITY zlib-fpic-patch "zlib-&zlib-version;-fPIC-2.patch">
+<!ENTITY zlib-fpic-patch-md5 "b1e6644c97b04c368e11c0a1554f2efe">
 <!ENTITY zlib-fpic-patch-size "3 KB">
Index: tches/zlib-1.2.3-fPIC-1.patch
===================================================================
--- patches/zlib-1.2.3-fPIC-1.patch	(revision 7c627cb2a57140b55a48ac0990d06d7e75821b92)
+++ 	(revision )
@@ -1,93 +1,0 @@
-Submitted By: Tushar Teredesai <tushar@linuxfromscratch.org>
-Date: 2005-06-14
-Initial Package Version: 1.2.2
-Origin: Gentoo ebuild?
-Upstream Status: Not submitted
-Description:
- 1. Build shared and static lib in one pass
- 2. Always add -fPIC when building shared lib, don't expect the user to set it.
-
-To build the shared and static library:
-	./configure --prefix=<prefix> --shared &&
-	make &&
-	make install
-Remove the --shared if you don't want the shared lib.
-
-diff -Naur zlib-1.2.2.orig/configure zlib-1.2.2/configure
---- zlib-1.2.2.orig/configure	2004-09-07 00:50:06.000000000 -0500
-+++ zlib-1.2.2/configure	2005-02-05 01:34:08.553292416 -0600
-@@ -73,7 +73,11 @@
- 
- if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then
-   CC="$cc"
--  SFLAGS=${CFLAGS-"-fPIC -O3"}
-+  #SFLAGS=${CFLAGS-"-fPIC -O3"}
-+  # the above is horribly wrong on a few archs where -fPIC should ALWAYS be
-+  # used in the creation of shared libraries. without the following, the
-+  # shared lib test will sometimes fail even when shared libs -can- be created.
-+  SFLAGS="${CFLAGS-"-O3"} -fPIC"
-   CFLAGS="$cflags"
-   case `(uname -s || echo unknown) 2>/dev/null` in
-   Linux | linux | GNU | GNU/*) LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1"};;
-@@ -158,7 +162,7 @@
-   if test "`($CC -c $SFLAGS $test.c) 2>&1`" = "" &&
-      test "`($LDSHARED -o $test$shared_ext $test.o) 2>&1`" = ""; then
-     CFLAGS="$SFLAGS"
--    LIBS="$SHAREDLIBV"
-+    LIBS="$LIBS $SHAREDLIBV"
-     echo Building shared library $SHAREDLIBV with $CC.
-   elif test -z "$old_cc" -a -z "$old_cflags"; then
-     echo No shared library support.
-diff -Naur zlib-1.2.2.orig/Makefile.in zlib-1.2.2/Makefile.in
---- zlib-1.2.2.orig/Makefile.in	2004-09-15 09:27:20.000000000 -0500
-+++ zlib-1.2.2/Makefile.in	2005-02-05 01:33:49.703158072 -0600
-@@ -49,6 +49,8 @@
- OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
-        zutil.o inflate.o infback.o inftrees.o inffast.o
- 
-+PIC_OBJS = $(OBJS:%.o=%.lo)
-+
- OBJA =
- # to use the asm code: make OBJA=match.o
- 
-@@ -77,8 +79,11 @@
- 	mv _match.o match.o
- 	rm -f _match.s
- 
--$(SHAREDLIBV): $(OBJS)
--	$(LDSHARED) -o $@ $(OBJS)
-+%.lo: %.c
-+	$(CC) $(CFLAGS) -DPIC -fPIC -c $< -o $@
-+
-+$(SHAREDLIBV): $(PIC_OBJS)
-+	$(LDSHARED) -o $@ $(PIC_OBJS) -lc
- 	rm -f $(SHAREDLIB) $(SHAREDLIBM)
- 	ln -s $@ $(SHAREDLIB)
- 	ln -s $@ $(SHAREDLIBM)
-@@ -89,13 +94,10 @@
- minigzip$(EXE): minigzip.o $(LIBS)
- 	$(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
- 
--install: $(LIBS)
-+install-libs: $(LIBS)
- 	-@if [ ! -d $(exec_prefix) ]; then mkdir -p $(exec_prefix); fi
--	-@if [ ! -d $(includedir)  ]; then mkdir -p $(includedir); fi
- 	-@if [ ! -d $(libdir)      ]; then mkdir -p $(libdir); fi
- 	-@if [ ! -d $(man3dir)     ]; then mkdir -p $(man3dir); fi
--	cp zlib.h zconf.h $(includedir)
--	chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h
- 	cp $(LIBS) $(libdir)
- 	cd $(libdir); chmod 755 $(LIBS)
- 	-@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
-@@ -110,6 +112,11 @@
- # The ranlib in install is needed on NeXTSTEP which checks file times
- # ldconfig is for Linux
- 
-+install: install-libs
-+	-@if [ ! -d $(includedir)  ]; then mkdir $(includedir); fi
-+	cp zlib.h zconf.h $(includedir)
-+	chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h
-+
- uninstall:
- 	cd $(includedir); \
- 	cd $(libdir); rm -f libz.a; \
Index: patches/zlib-1.2.3-fPIC-2.patch
===================================================================
--- patches/zlib-1.2.3-fPIC-2.patch	(revision ecd738705ca20828083d88ef1d47d14dcd6e26d6)
+++ patches/zlib-1.2.3-fPIC-2.patch	(revision ecd738705ca20828083d88ef1d47d14dcd6e26d6)
@@ -0,0 +1,112 @@
+Submitted By: Jim Gifford  <jim at cross-lfs dot org>
+Originally Submitted By: Tushar Teredesai <tushar@linuxfromscratch.org>
+Date: 2009-05-7
+Initial Package Version: 1.2.2
+Origin: Gentoo ebuild?
+Upstream Status: Not submitted
+Description:
+ 1. Build shared and static lib in one pass
+ 2. Always add -fPIC when building shared lib, don't expect the user to set it.
+
+To build the shared and static library:
+	./configure --prefix=<prefix> --shared &&
+	make &&
+	make install
+Remove the --shared if you don't want the shared lib.
+
+diff -Naur zlib-1.2.3.orig/configure zlib-1.2.3/configure
+--- zlib-1.2.3.orig/configure	2005-07-11 13:11:57.000000000 -0700
++++ zlib-1.2.3/configure	2009-05-07 12:09:31.000000000 -0700
+@@ -23,7 +23,7 @@
+ VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`
+ VER2=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\)\\..*/\1/p' < zlib.h`
+ VER1=`sed -n -e '/VERSION "/s/.*"\([0-9]*\)\\..*/\1/p' < zlib.h`
+-AR=${AR-"ar rc"}
++AR=${AR-"ar"}
+ RANLIB=${RANLIB-"ranlib"}
+ prefix=${prefix-/usr/local}
+ exec_prefix=${exec_prefix-'${prefix}'}
+@@ -73,7 +73,11 @@
+ 
+ if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then
+   CC="$cc"
+-  SFLAGS=${CFLAGS-"-fPIC -O3"}
++  #SFLAGS=${CFLAGS-"-fPIC -O3"}
++  # the above is horribly wrong on a few archs where -fPIC should ALWAYS be
++  # used in the creation of shared libraries. without the following, the
++  # shared lib test will sometimes fail even when shared libs -can- be created.
++  SFLAGS="${CFLAGS-"-O3"} -fPIC"
+   CFLAGS="$cflags"
+   case `(uname -s || echo unknown) 2>/dev/null` in
+   Linux | linux | GNU | GNU/*) LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1"};;
+@@ -174,7 +178,7 @@
+   if test "`($CC -c $SFLAGS $test.c) 2>&1`" = "" &&
+      test "`($LDSHARED -o $test$shared_ext $test.o) 2>&1`" = ""; then
+     CFLAGS="$SFLAGS"
+-    LIBS="$SHAREDLIBV"
++    LIBS="$LIBS $SHAREDLIBV"
+     echo Building shared library $SHAREDLIBV with $CC.
+   elif test -z "$old_cc" -a -z "$old_cflags"; then
+     echo No shared library support.
+diff -Naur zlib-1.2.3.orig/Makefile.in zlib-1.2.3/Makefile.in
+--- zlib-1.2.3.orig/Makefile.in	2005-07-17 19:25:21.000000000 -0700
++++ zlib-1.2.3/Makefile.in	2009-05-07 12:10:15.000000000 -0700
+@@ -49,6 +49,8 @@
+ OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
+        zutil.o inflate.o infback.o inftrees.o inffast.o
+ 
++PIC_OBJS = $(OBJS:%.o=%.lo)
++
+ OBJA =
+ # to use the asm code: make OBJA=match.o
+ 
+@@ -68,7 +70,7 @@
+ 	fi
+ 
+ libz.a: $(OBJS) $(OBJA)
+-	$(AR) $@ $(OBJS) $(OBJA)
++	$(AR) rc $@ $(OBJS) $(OBJA)
+ 	-@ ($(RANLIB) $@ || true) >/dev/null 2>&1
+ 
+ match.o: match.S
+@@ -77,8 +79,11 @@
+ 	mv _match.o match.o
+ 	rm -f _match.s
+ 
+-$(SHAREDLIBV): $(OBJS)
+-	$(LDSHARED) -o $@ $(OBJS)
++%.lo: %.c
++	$(CC) $(CFLAGS) -DPIC -fPIC -c $< -o $@
++
++$(SHAREDLIBV): $(PIC_OBJS)
++	$(LDSHARED) -o $@ $(PIC_OBJS) -lc
+ 	rm -f $(SHAREDLIB) $(SHAREDLIBM)
+ 	ln -s $@ $(SHAREDLIB)
+ 	ln -s $@ $(SHAREDLIBM)
+@@ -89,13 +94,10 @@
+ minigzip$(EXE): minigzip.o $(LIBS)
+ 	$(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
+ 
+-install: $(LIBS)
++install-libs: $(LIBS)
+ 	-@if [ ! -d $(exec_prefix) ]; then mkdir -p $(exec_prefix); fi
+-	-@if [ ! -d $(includedir)  ]; then mkdir -p $(includedir); fi
+ 	-@if [ ! -d $(libdir)      ]; then mkdir -p $(libdir); fi
+ 	-@if [ ! -d $(man3dir)     ]; then mkdir -p $(man3dir); fi
+-	cp zlib.h zconf.h $(includedir)
+-	chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h
+ 	cp $(LIBS) $(libdir)
+ 	cd $(libdir); chmod 755 $(LIBS)
+ 	-@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
+@@ -110,6 +112,11 @@
+ # The ranlib in install is needed on NeXTSTEP which checks file times
+ # ldconfig is for Linux
+ 
++install: install-libs
++	-@if [ ! -d $(includedir)  ]; then mkdir $(includedir); fi
++	cp zlib.h zconf.h $(includedir)
++	chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h
++
+ uninstall:
+ 	cd $(includedir); \
+ 	cd $(libdir); rm -f libz.a; \
