--- dietlibc-0.31.orig/debian/dietlibc-doc.README.Debian
+++ dietlibc-0.31/debian/dietlibc-doc.README.Debian
@@ -0,0 +1,22 @@
+dietlibc for Debian
+-------------------
+
+See /usr/share/doc/dietlibc-doc/README on how to use the diet libc to
+compile programs.
+
+Static, and on some architectures shared, libraries are installed in
+/usr/lib/diet/lib/.  Include files are installed in /usr/include/diet/,
+and additionally available through /usr/lib/diet/include/.  The diet gcc
+wrapper is installed in /usr/bin/, and additionally available through
+/usr/lib/diet/bin/.
+
+If you want to build Debian packages with the diet libc, try to set the
+environment variable DEB_BUILD_OPTIONS=diet when building the package;
+some Debian packages recognize this, and build a diet package then.
+
+Debian packages that provide diet compiled libraries should install them
+into /usr/lib/diet/lib/, or optionally in /usr/lib/diet/<pkg>/.  Include
+files should be made available through /usr/include/diet/<pkg>/, or
+optionally installed in /usr/include/diet/.
+
+ -- Gerrit Pape <pape@smarden.org>, Sun, 20 Jun 2004 17:28:40 +0000
--- dietlibc-0.31.orig/debian/copyright
+++ dietlibc-0.31/debian/copyright
@@ -0,0 +1,24 @@
+This package was debianized by Gerrit Pape <pape@smarden.org> on
+Sun,  5 May 2002 19:23:41 +0200.
+
+It was downloaded from http://www.fefe.de/dietlibc/
+
+Upstream Author: Felix von Leitner <felix-dietlibc@fefe.de>
+
+Copyright:
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+The full text of the GPL can be found at /usr/share/common-licenses/GPL-2.
--- dietlibc-0.31.orig/debian/implicit
+++ dietlibc-0.31/debian/implicit
@@ -0,0 +1,93 @@
+# $Id: implicit,v 1.11 2005/11/29 21:57:55 pape Exp $
+
+.PHONY: deb-checkdir deb-checkuid
+
+deb-checkdir:
+	@test -e debian/control || sh -cx '! : wrong directory'
+deb-checkuid:
+	@test "`id -u`" -eq 0 || sh -cx '! : need root privileges'
+
+%.deb: %.deb-docs %.deb-DEBIAN
+	@rm -f $*.deb $*.deb-checkdir $*.deb-docs $*.deb-docs-base \
+	  $*.deb-docs-docs $*.deb-docs-examples $*.deb-DEBIAN \
+	  $*.deb-DEBIAN-dir $*.deb-DEBIAN-scripts $*.deb-DEBIAN-md5sums
+
+%.udeb: %.deb-DEBIAN
+	@rm -f $*.deb $*.deb-checkdir $*.deb-DEBIAN $*.deb-DEBIAN-dir \
+	  $*.deb-DEBIAN-scripts $*.deb-DEBIAN-md5sums
+
+%.deb-checkdir:
+	@test -d debian/$* || sh -cx '! : directory debian/$* missing'
+	@test "`id -u`" -eq 0 || sh -cx '! : need root privileges'
+
+%.deb-docs-base:
+	: implicit
+	@rm -f debian/$*/usr/share/doc/$*/* || :
+	@install -d -m0755 debian/$*/usr/share/doc/$*
+	: debian/$*/usr/share/doc/$*/
+	@sh -cx 'install -m0644 debian/copyright debian/$*/usr/share/doc/$*/'
+	@sh -cx 'install -m0644 debian/changelog \
+	  debian/$*/usr/share/doc/$*/changelog.Debian'
+	@test ! -r changelog || \
+	  sh -cx 'install -m0644 changelog debian/$*/usr/share/doc/$*/'
+	@test -r debian/$*/usr/share/doc/$*/changelog || \
+	  sh -cx 'mv debian/$*/usr/share/doc/$*/changelog.Debian \
+	    debian/$*/usr/share/doc/$*/changelog'
+	@test -s debian/$*/usr/share/doc/$*/changelog || \
+	  sh -cx 'rm -f debian/$*/usr/share/doc/$*/changelog'
+	@gzip -9 debian/$*/usr/share/doc/$*/changelog*
+%.deb-docs-docs:
+	@for i in `cat debian/$*.docs 2>/dev/null || :`; do \
+	  if test -d $$i; then \
+	    sh -cx "install -d -m0755 debian/$*/usr/share/doc/$*/$${i##*/}" && \
+	    for j in $$i/*; do \
+	      sh -cx "install -m0644 $$j \
+	        debian/$*/usr/share/doc/$*/$${i##*/}/" || exit 1; \
+	    done || exit 1; \
+	    continue; \
+	  fi; \
+	  sh -cx "install -m0644 $$i debian/$*/usr/share/doc/$*/" || exit 1; \
+	done
+	@test ! -r debian/$*.README.Debian || \
+	  sh -cx 'install -m0644 debian/$*.README.Debian \
+	    debian/$*/usr/share/doc/$*/README.Debian'
+	@if test -r debian/$*.NEWS.Debian; then \
+	  sh -cx 'install -m0644 debian/$*.NEWS.Debian \
+	    debian/$*/usr/share/doc/$*/NEWS.Debian && \
+	      gzip -9 debian/$*/usr/share/doc/$*/NEWS.Debian'; \
+	fi
+%.deb-docs-examples:
+	@rm -rf debian/$*/usr/share/doc/$*/examples
+	: debian/$*/usr/share/doc/$*/examples/
+	@test ! -r debian/$*.examples || \
+	  install -d -m0755 debian/$*/usr/share/doc/$*/examples
+	@for i in `cat debian/$*.examples 2>/dev/null || :`; do \
+	  sh -cx "install -m0644 $$i debian/$*/usr/share/doc/$*/examples/" \
+	    || exit 1; \
+	done
+%.deb-docs: %.deb-checkdir %.deb-docs-base %.deb-docs-docs %.deb-docs-examples
+	: debian/$*/usr/share/doc/$*/ ok
+
+%.deb-DEBIAN-base:
+	@rm -rf debian/$*/DEBIAN
+	: debian/$*/DEBIAN/
+	@install -d -m0755 debian/$*/DEBIAN
+	@for i in conffiles shlibs templates; do \
+	  test ! -r debian/$*.$$i || \
+	    sh -cx "install -m0644 debian/$*.$$i debian/$*/DEBIAN/$$i" \
+	      || exit 1; \
+	done
+%.deb-DEBIAN-scripts:
+	@for i in preinst prerm postinst postrm config; do \
+	  test ! -r debian/$*.$$i || \
+	    sh -cx "install -m0755 debian/$*.$$i debian/$*/DEBIAN/$$i" \
+	      || exit 1; \
+	done
+%.deb-DEBIAN-md5sums:
+	: debian/$*/DEBIAN/md5sums
+	@rm -f debian/$*/DEBIAN/md5sums
+	@cd debian/$* && find * -path 'DEBIAN' -prune -o \
+	  -type f -exec md5sum {} >>DEBIAN/md5sums \;
+%.deb-DEBIAN: %.deb-checkdir %.deb-DEBIAN-base %.deb-DEBIAN-scripts \
+	  %.deb-DEBIAN-md5sums
+	: debian/$*/DEBIAN/ ok
--- dietlibc-0.31.orig/debian/control
+++ dietlibc-0.31/debian/control
@@ -0,0 +1,54 @@
+Source: dietlibc
+Section: devel
+Priority: optional
+Maintainer: Gerrit Pape <pape@smarden.org>
+Standards-Version: 3.7.2.0
+
+Package: dietlibc-dev
+Section: libdevel
+Architecture: alpha amd64 arm hppa i386 ia64 mips mipsel powerpc ppc64 s390 sparc
+Recommends: dietlibc (= ${source:Version})
+Suggests: dietlibc-doc
+Description: diet libc - a libc optimized for small size
+ The diet libc is a C library that is optimized for small size. It
+ can be used to create small statically linked binaries for Linux
+ on alpha, arm, ia64, mips, mipsel, ppc, parisc, s390, sparc and x86.
+ .
+ This package is used to compile programs with the diet libc.
+ .
+ The diet libc also supports dynamic linking, currently on the arm and
+ i386 architectures only.  The 'dietlibc' package provides the shared
+ libraries.
+ .
+ See http://www.fefe.de/dietlibc/ for more information.
+
+Package: dietlibc
+Section: libs
+Architecture: i386
+Suggests: dietlibc-doc, dietlibc-dev
+Description: diet libc shared libraries - a libc optimized for small size
+ The diet libc is a C library that is optimized for small size. It
+ can be used to create small statically linked binaries for Linux
+ on alpha, arm, ia64, mips, mipsel, ppc, parisc, sparc and x86.
+ .
+ The diet libc also supports dynamic linking, currently on the arm and
+ i386 architectures only. This package provides the shared libraries.
+ .
+ See http://www.fefe.de/dietlibc/ for more information.
+
+Package: dietlibc-doc
+Architecture: all
+Section: doc
+Suggests: dietlibc-dev, dietlibc
+Description: diet libc documentation - a libc optimized for small size
+ The diet libc is a C library that is optimized for small size. It
+ can be used to create small statically linked binaries for Linux
+ on alpha, arm, ia64, mips, mipsel, ppc, parisc, s390, sparc and x86.
+ .
+ This package contains the documentation for the diet libc.
+ .
+ The diet libc also supports dynamic linking, currently on the arm and
+ i386 architectures only. The dietlibc package provides the shared
+ libraries.
+ .
+ See http://www.fefe.de/dietlibc/ for more information.
--- dietlibc-0.31.orig/debian/dietlibc.conffiles
+++ dietlibc-0.31/debian/dietlibc.conffiles
@@ -0,0 +1 @@
+/etc/diet.ld.conf
--- dietlibc-0.31.orig/debian/changelog
+++ dietlibc-0.31/debian/changelog
@@ -0,0 +1,760 @@
+dietlibc (0.31-1.2~bpo40+1) etch-backports; urgency=low
+
+  * Backport testing version for backports.org (no changes)
+
+ -- Micah Anderson <micah@debian.org>  Tue, 13 Jan 2009 12:14:36 -0700
+
+dietlibc (0.31-1.2) unstable; urgency=medium
+
+  * Non-maintainer upload from the Cambridge BSP.
+  * debian/diff/0011-undefined-symbol-umount2-alpha-ia64.diff: treat
+    __NR_umount as the 2-argument version on ia64 (really closes: #508397)
+  * debian/diff/0012-Add-an-implementation-of-umount-3-for-ia64.diff:
+    supply a 1-argument version of umount on ia64
+  * Verified to pass MNT_DETACH to the kernel in the expected way on ia64
+  * Verified with strace to do the same thing as glibc on architectures 
+    representing the other three families mentioned in 0011-*.diff
+    (i386, x86_64 and alpha)
+
+ -- Simon McVittie <smcv@debian.org>  Sat, 03 Jan 2009 17:11:00 +0000
+
+dietlibc (0.31-1.1) unstable; urgency=high
+
+  * Non-maintainer upload.
+  * debian/diff/0011-undefined-symbol-umount2-alpha-ia64.diff: 
+    new; util-vserver: fails to compile on alpha and ia64 due to
+    unresolved umount2 symbols, thanks to Daniel Hokka Zakrisson and
+    Herbert Poetzel, closes: #508397)
+
+ -- Micah Anderson <micah@debian.org>  Thu, 11 Dec 2008 11:28:17 -0500
+
+dietlibc (0.31-1) unstable; urgency=low
+
+  * new upstream version.
+  * debian/control: Recommends: dietlibc (= ${source:Version}) instead of
+    ${Source-Version}.
+  * debian/diff/????-cvs-snapshot-200705030800.diff: remove; obsolete.
+  * debian/diff/????-arm-syscalls.h-fix-__ARGS_-according-to-comment.diff,
+    debian/diff/????-arm-syscalls.h-add-__ARGS_mbind-__ARGS_get_mempolic.diff:
+    remove; fixed upstream.
+  * debian/diff/0010-util-vserver-vsched-fails-to-read-config-directory.diff:
+    new; util-vserver: vsched fails to read config directory (patch from
+    http://people.linux-vserver.org/~dhozac/p/m/delta-dietdirent-fix01.diff,
+    thx Daniel Hokka Zakrisson, closes: #435538).
+
+ -- Gerrit Pape <pape@smarden.org>  Sun, 26 Aug 2007 10:02:26 +0000
+
+dietlibc (0.30-7) unstable; urgency=low
+
+  * debian/diff/0012-workaround-Bug-428814-powerpc-error-initializer-e.diff:
+    new; workaround Bug#428814: [powerpc] error: initializer element is not
+    constant (fixes build failure on powerpc).
+
+ -- Gerrit Pape <pape@smarden.org>  Mon, 02 Jul 2007 09:59:03 +0000
+
+dietlibc (0.30-6) unstable; urgency=low
+
+  * debian/diff/ia64-no-fno-omit-frame-pointer.diff: remove; obsolete
+    (see #286840).
+  * debian/diff/*: redo diffs with git.
+  * debian/diff/0010-arm-syscalls.h-fix-__ARGS_-according-to-comment.diff:
+    new; arm/syscalls.h: fix __ARGS_* according to comment.
+  * debian/diff/0011-arm-syscalls.h-add-__ARGS_mbind-__ARGS_get_mempolic.diff:
+    new; arm/syscalls.h: add __ARGS_mbind, __ARGS_get_mempolicy,
+    __ARGS_set_mempolicy (fixes build failure on arm).
+  * debian/rules: apply diffs with patch -p1, not -p0.
+
+ -- Gerrit Pape <pape@smarden.org>  Thu, 03 May 2007 10:12:39 +0000
+
+dietlibc (0.30-5) unstable; urgency=low
+
+  * debian/diff/cvs-20070411.diff: new; cvs snapshot 20070411.
+
+ -- Gerrit Pape <pape@smarden.org>  Wed, 11 Apr 2007 08:27:19 +0000
+
+dietlibc (0.30-4) unstable; urgency=high
+
+  * debian/diff/select.diff: remove again; doesn't work for all archs.
+  * debian/diff/ppc-select.diff: new; use syscall _newselect instead of
+    select on ppc (closes: #394928).
+
+ -- Gerrit Pape <pape@smarden.org>  Tue, 31 Oct 2006 07:53:57 +0000
+
+dietlibc (0.30-3) unstable; urgency=high
+
+  * debian/diff/select.diff: new; use syscall _newselect on all archs (thx
+    Bastian Blank, closes: #394928).
+  * debian/rules: run select selftest after building.
+
+ -- Gerrit Pape <pape@smarden.org>  Mon, 30 Oct 2006 20:57:45 +0000
+
+dietlibc (0.30-2) unstable; urgency=low
+
+  * debian/diff/parisc-sem.diff: new; parisc has the semctl, semop,
+    semget syscalls (closes: #393678).
+  * debian/diff/no-clobber-home.diff: new; don't clobber the HOME
+    environment variable for the duration of the build (closes: #393682,
+    thx Ted Percival).
+
+ -- Gerrit Pape <pape@smarden.org>  Tue, 17 Oct 2006 19:11:27 +0000
+
+dietlibc (0.30-1) unstable; urgency=low
+
+  * new upstream version.
+  * debian/diff/cvs-20060609.diff: remove; obsolete.
+  * debian/diff/ia64-proc-endp.diff, debian/diff/xarm-comment-char.diff:
+    remove; fixed upstream.
+  * debian/diff/arm-waitpid.diff: remove; possibly out of date, and we
+    stopped building dynamic lib on arm anyway.
+  * debian/diff/mips-pic.diff: adapt.
+  * debian/diff/parisc-iitlbp.diff: minor.
+
+ -- Gerrit Pape <pape@smarden.org>  Sat,  8 Jul 2006 13:34:24 +0000
+
+dietlibc (0.29-15) unstable; urgency=low
+
+  * debian/diff/no-ssp.diff: don't WANT_SSP; it causes similar problems as
+    WANT_STACKGAP back in Dec 2004 (closes: #374349).
+  * debian/diff/xgcc-4.1-ssp.diff: remove, ssp is disabled.
+
+ -- Gerrit Pape <pape@smarden.org>  Mon, 19 Jun 2006 18:02:34 +0000
+
+dietlibc (0.29-14) unstable; urgency=low
+
+  * debian/diff/xarm-comment-char.diff: new: s/@/%/ for arm assembler (fixes
+    build failure on arm).
+  * debian/diff/xgcc-4.1-ssp.diff: new: ssp with gcc 4.1 needs __guard.o
+    in libc.so (fixes build failure on i386).
+
+ -- Gerrit Pape <pape@smarden.org>  Wed, 14 Jun 2006 16:17:05 +0000
+
+dietlibc (0.29-13) unstable; urgency=low
+
+  * debian/diff/cvs-20060609.diff: new: cvs snapshot from 200606090800.
+  * debian/diff/cvs-20060416.diff: remove; obsolete.
+  * debian/diff/fflush-null.diff: don't skip flushing streams with
+    flags&BUFINPUT (closes: #370274).
+  * debian/rules: fix sed script for parsing debian/dietlibc-dev.*.in
+    (closes: #372178).
+
+ -- Gerrit Pape <pape@smarden.org>  Sat, 10 Jun 2006 10:37:12 +0000
+
+dietlibc (0.29-12) unstable; urgency=low
+
+  * debian/diff/fflush-null.diff: new; fflush(NULL): don't flush input
+    streams (stdin) (closes: #346437).
+  * debian/control: Standards-Version: 3.7.2.0.
+  * debian/dietlibc-dev.prerm.in: minor.
+
+ -- Gerrit Pape <pape@smarden.org>  Fri, 26 May 2006 18:29:49 +0000
+
+dietlibc (0.29-11) unstable; urgency=low
+
+  * debian/diff/cvs-20060416.diff: new: cvs snapshot from 200604161700.
+  * debian/diff/cvs-20051012.diff: remove; obsolete.
+  * debian/diff/patch-diet-parisc-fix06.diff, debian/diff/s390-mmap.diff:
+    remove; applied upstream cvs.
+  * debian/implicit: update to revision 1.11.
+
+ -- Gerrit Pape <pape@smarden.org>  Sun, 16 Apr 2006 17:55:52 +0000
+
+dietlibc (0.29-10) unstable; urgency=low
+
+  * debian/diff/patch-diet-parisc-fix06.diff: new; fixes issues with the
+    parisc syscalls that all contain 5 or 6 arguments (thx Herbert Poetzwl,
+    Micah Anderson, closes: #351875, #360007).
+  * debian/diff/parisc-sendto-recvfrom.diff: remove; obsolete.
+
+ -- Gerrit Pape <pape@smarden.org>  Sat,  1 Apr 2006 10:31:30 +0000
+
+dietlibc (0.29-9) unstable; urgency=low
+
+  * debian/diff/s390-mmap.diff: new; fix mmap and missing mmap64
+    implementation for s390 (thx Bastian Blank, closes: #356557).
+
+ -- Gerrit Pape <pape@smarden.org>  Mon, 20 Mar 2006 20:27:13 +0000
+
+dietlibc (0.29-8) unstable; urgency=low
+
+  * debian/rules: binary-arch: set MYARCH on make install also (fixes build
+    failure on sparc).
+
+ -- Gerrit Pape <pape@smarden.org>  Thu, 22 Dec 2005 16:30:02 +0000
+
+dietlibc (0.29-7) unstable; urgency=low
+
+  * debian/diff/parisc-sendto-recvfrom.diff: new: fix sendto(), recvfrom()
+    on hppa.
+
+ -- Gerrit Pape <pape@smarden.org>  Tue, 20 Dec 2005 13:14:04 +0000
+
+dietlibc (0.29-6) unstable; urgency=low
+
+  * debian/diff/parisc-iitlbp.diff: new; from glibc: Update hppa assembly
+    for current CVS binutils (fixes build failure on hppa).
+
+ -- Gerrit Pape <pape@smarden.org>  Sun, 16 Oct 2005 18:29:25 +0000
+
+dietlibc (0.29-5) unstable; urgency=low
+
+  * debian/dietlibc-dev.prerm.in: new; remove /usr/lib/diet/lib-|ARCH| on
+    'remove'.
+  * debian/rules: create debian/dietlibc-dev.prerm from
+    debian/dietlibc-dev.prerm.in (closes: #328283).
+  * debian/diff/cvs-20051012.diff: new; cvs snapshot from 200510120900.
+  * debian/diff/cvs-20050731.diff, debian/diff/rpc_svcauth_.diff: remove;
+    obsolete.
+
+ -- Gerrit Pape <pape@smarden.org>  Wed, 12 Oct 2005 09:12:58 +0000
+
+dietlibc (0.29-4) unstable; urgency=low
+
+  * ia64-proc-endp.diff: new; ia64 asm: A2124 previous proedure not yet
+    ended (fixes build failure on ia64).
+  * debian/control, debian/rules: no longer build dynamic library on arm,
+    it's not really usable anyway (fixes build failure on arm).
+
+ -- Gerrit Pape <pape@smarden.org>  Sat, 13 Aug 2005 13:59:57 +0000
+
+dietlibc (0.29-3) unstable; urgency=low
+
+  * debian/diff/cvs-20050731.diff: new; cvs snapshot from 200507311100.
+
+ -- Gerrit Pape <pape@smarden.org>  Sun, 31 Jul 2005 11:25:07 +0000
+
+dietlibc (0.29-2) unstable; urgency=low
+
+  * debian/diff/arm-waitpid.diff: new; re-add #define __NR_waitpid for arm
+    (works around build failure of dynamic lib on arm; still not really
+    usable though).
+
+ -- Gerrit Pape <pape@smarden.org>  Sun, 29 May 2005 10:51:51 +0000
+
+dietlibc (0.29-1) unstable; urgency=low
+
+  * new upstream version.
+    - switches gcc option -malign-functions to -falign-functions in diet on
+      i386 (no longer supports gcc 2, closes: #234961).
+  * debian/diff/LD_RUN_PATH.diff, debian/diff/__powerpc__.diff,
+    debian/diff/dns-decoding.diff, debian/diff/fcntl.h.diff,
+    debian/diff/s390-select.diff, debian/diff/siginfo-64bit.diff: remove;
+    obsolete.
+
+ -- Gerrit Pape <pape@smarden.org>  Wed, 25 May 2005 19:33:41 +0000
+
+dietlibc (0.28-3) unstable; urgency=medium
+
+  * debian/diff/s390-select.diff: new; add select for s390 (using
+    _newselect) (see #297806).
+
+ -- Gerrit Pape <pape@smarden.org>  Mon, 28 Mar 2005 12:28:30 +0000
+
+dietlibc (0.28-2) unstable; urgency=low
+
+  * debian/control: add Architecture: ppc64 (thx Andreas Jochens, closes:
+    #299226).
+  * debian/diff/LD_RUN_PATH.diff: new; from upstream cvs: oops, fix
+    LD_RUN_PATH unsetting (Enrico Scholz).
+  * debian/diff/__powerpc__.diff: new; from upstream cvs: #ifdef powerpc ->
+    #ifdef __powerpc__ (Enrico Scholz) (closes: #300917).
+  * debian/diff/dns-decoding.diff: new; from upstream cvs: fix stupid dns
+    decoding bug (Gernot Tenchio) (plus undocumented __NO_STAT64 fix).
+  * debian/diff/siginfo-64bit.diff: new; from upstream cvs: struct siginfo
+    was wrong for 64-bit platforms.
+  * debian/diff/fcntl.h.diff: new; update to include/fcntl.h from cvs
+    20050325 (don't include readahead(2)).
+
+ -- Gerrit Pape <pape@smarden.org>  Fri, 25 Mar 2005 13:22:38 +0000
+
+dietlibc (0.28-1) unstable; urgency=low
+
+  * new upstream version (.orig.tar.gz re-packaged without CVS/
+    directories).
+  * debian/diff/cvs-20041219.diff: remove; obsolete.
+  * debian/diff/nice.diff: adapt; still set errno=EPERM on error.
+  * debian/dietlibc-doc.docs: add README.security.
+  * debian/rules: minor.
+
+ -- Gerrit Pape <pape@smarden.org>  Mon, 31 Jan 2005 22:21:06 +0000
+
+dietlibc (0.27-7) unstable; urgency=low
+
+  * debian/diff/ia64-no-fno-omit-frame-pointer.diff: new; don't use
+    -fno-omit-frame-pointer on ia64 (works around #286840).
+  * debian/rules: get VERSION from debian/changelog.
+  * debian/diff/nice.diff: update; set errno=EPERM on error.
+
+ -- Gerrit Pape <pape@smarden.org>  Thu, 23 Dec 2004 14:18:36 +0000
+
+dietlibc (0.27-6) unstable; urgency=low
+
+  * debian/diff/nice.diff: new; fixes nice() on alpha, ia64 (closes:
+    #286603).
+
+ -- Gerrit Pape <pape@smarden.org>  Tue, 21 Dec 2004 11:06:32 +0000
+
+dietlibc (0.27-5) unstable; urgency=low
+
+  * debian/diff/cvs-20041219.diff: new; cvs snapshot (closes: #285631).
+  * debian/diff/mmap64.diff, debian/diff/strcat-compliant.diff,
+    debian/diff/cvs-20041207.diff: remove; included upstream.
+
+ -- Gerrit Pape <pape@smarden.org>  Mon, 20 Dec 2004 19:57:06 +0000
+
+dietlibc (0.27-4) unstable; urgency=low
+
+  * debian/rules: announce VERSION='0.27-4' (also in dynlib package).
+  * debian/diff/make-clean.diff: remove; unneeded.
+  * debian/diff/mmap64.diff: new; (fixes build failure on arm; fixes build
+    failure of fnord on parisc, ppc).
+  * debian/diff/mips-pic.diff: re-add: still don't use -fno-pic on mips/el
+    (fixes build failure of cvm on mips/el).
+
+ -- Gerrit Pape <pape@smarden.org>  Fri, 10 Dec 2004 11:55:59 +0000
+
+dietlibc (0.27-3) unstable; urgency=low
+
+  * debian/diff/arm-waitpid.diff, debian/diff/mips-pic.diff: remove; fixed
+    in debian/diff/cvs-20041207.diff.
+  * debian/diff/64bitenviron.diff, debian/diff/64bitfixes.diff,
+    debian/diff/memleak.diff, debian/diff/setlocale.diff: remove; included
+    in debian/diff/cvs-20041207.diff.
+  * debian/diff/cvs-20041207.diff: new; cvs snapshot.
+  * debian/diff/rpc_svcauth_.diff: new; make _svcauth_unix, _svcauth_short
+    non-static.
+  * debian/rules: apply diffs in order; announce VERSION='0.27-3'.
+  * debian/dietlibc-dev.postinst.in: minor.
+  * debian/diff/strcat-compliant.diff: new; don't WANT_NON_COMPLIANT_STRNCAT.
+
+ -- Gerrit Pape <pape@smarden.org>  Tue,  7 Dec 2004 18:15:08 +0000
+
+dietlibc (0.27-2) unstable; urgency=medium
+
+  * debian/diff/64bitenviron.diff: new; from upstream cvs:
+      #include <endian.h> in syscalls.s/environ.S to make sure environ is
+        actually large enough (Enrico Scholz) (closes: #273748).
+  * debian/diff/64bitfixes.diff: new; from upstream cvs:
+      several fixes from Gwenole Beauchesne, AMD64 and otherwise.
+  * debian/diff/memleak.diff: new; from upstream cvs:
+      fix memory leak in regfree (thanks, Valgrind!).
+  * debian/diff/setlocale.diff: new; from upstream cvs:
+      setlocale now accepts setting the locale to "C".
+
+ -- Gerrit Pape <pape@smarden.org>  Tue, 28 Sep 2004 17:25:12 +0000
+
+dietlibc (0.27-1) unstable; urgency=low
+
+  * new upstream version.
+  * debian/copyright: minor.
+  * debian/implicit: update to revision 1.10.
+  * debian/dietlibc-dev.postinst.in: typo.
+  * debian/rules: minor cleanup.
+  * debian/diff/cvs-20040620.diff: remove; obsolete.
+
+ -- Gerrit Pape <pape@smarden.org>  Sat, 31 Jul 2004 20:03:44 +0000
+
+dietlibc (0.26-3) unstable; urgency=low
+
+  * debian/diff/cvs-20040609.diff: remove.
+  * debian/diff/ppc-redefinition.diff: remove; fixed upstream.
+  * debian/diff/cvs-20040620.diff: new; cvs snapshot:
+    o PowerPC build fix (Gerrit Pape)
+    o Olaf: added missing settimeofday
+    o add netinet/ether.h and netinet/if_ether.h
+  * debian/rules: install diet compiled libraries in /usr/lib/diet/lib/
+    (static and shared); process dietlibc-dev.postinst.in; minor.
+  * debian/dietlibc-dev.postinst.in: make sure /usr/lib/diet/lib-$(ARCH) ->
+    lib is a symlink, move libraries if necessary.
+  * debian/dietlibc-doc.README.Debian: new; document DEB_BUILD_OPTIONS=diet
+    and where to put libraries, include files.
+
+ -- Gerrit Pape <pape@smarden.org>  Sun, 20 Jun 2004 18:14:51 +0000
+
+dietlibc (0.26-2) unstable; urgency=low
+
+  * debian/diff/ppc-redefinition.diff: new; remove duplicate definition from
+    include/asm/ppc-sigcontext.h (fixes build failure on ppc).
+
+ -- Gerrit Pape <pape@smarden.org>  Thu, 10 Jun 2004 09:28:58 +0000
+
+dietlibc (0.26-1) unstable; urgency=low
+
+  * new upstream version.
+  * debian/rules: remove ia64/waitpid.S workaround, fixed by upstream.
+  * debian/diff/make-clean.diff, debian/diff/mips-pic.diff: adapt to new
+    upstream version.
+  * debian/diff/cvs-20040609.diff: new; cvs snapshot:
+    o change DNS routines to look for ip6.arpa instead of ip6.int
+    o WANT_FREAD_OPTIMIZATION was broken on sockets (Johannes Stezenbach)
+    o added fix for getgrouplist (Nikola Vladov)
+    o fix the fd leak on error path (Denis Vlasenko)
+    o the regparm attribute in typedefinition generats error with gcc-2.95
+      on non-x86 arch... (reported: Johannes Stezenbach)
+
+ -- Gerrit Pape <pape@smarden.org>  Thu, 10 Jun 2004 07:15:35 +0000
+
+dietlibc (0.25-3) unstable; urgency=low
+
+  * debian/rules: remove erroneous ia64/waitpid.S before build.
+
+ -- Gerrit Pape <pape@smarden.org>  Fri, 28 May 2004 20:13:03 +0000
+
+dietlibc (0.25-2) unstable; urgency=low
+
+  * debian/control, debian/rules: dietlibc-dev package for amd64 (thx
+    Andreas Jochens; closes: #245292).
+
+ -- Gerrit Pape <pape@smarden.org>  Sun, 25 Apr 2004 05:15:48 +0000
+
+dietlibc (0.25-1) unstable; urgency=low
+
+  * new upstream version.
+  * debian/diff/cvs-20040325.diff: remove; obsolete.
+  * debian/implicit: update to revision 1.8.
+
+ -- Gerrit Pape <pape@smarden.org>  Sun, 28 Mar 2004 08:14:10 +0000
+
+dietlibc (0.24-5cvs20040325) unstable; urgency=low
+
+  * debian/diff/cvs-20040325.diff: new; cvs snapshot while waiting for 0.25;
+    (fixes #232200).
+  * debian/diff/arm-waitpid.diff: new; (fixes build problem with runit package
+    on arm).
+  * debian/diff/mips-pic.diff: adapt.
+  * debian/implicit: update to revision 1.7.
+  * debian/rules: typo.
+
+ -- Gerrit Pape <pape@smarden.org>  Thu, 25 Mar 2004 13:28:44 +0000
+
+dietlibc (0.24-4) unstable; urgency=medium
+
+  * debian/rules: set MYARCH=parisc on hppa, MYARCH=mips on mipsel (fixes
+    build failure on hppa, mipsel).
+
+ -- Gerrit Pape <pape@smarden.org>  Mon,  9 Feb 2004 10:35:12 +0000
+
+dietlibc (0.24-3) unstable; urgency=low
+
+  * debian/implicit: update to revision 1.5.
+  * debian/rules: override upstream's Makefile test for MYARCH with
+    dpkg-architecture -qDEB_HOST_ARCH; minor.
+
+ -- Gerrit Pape <pape@smarden.org>  Wed, 28 Jan 2004 10:51:46 +0000
+
+dietlibc (0.24-2) unstable; urgency=low
+
+  * debian/control: Standards-Version: 3.6.1.0; no longer Build-Depends:
+    debhelper.
+  * debian/copyright: quote license header.
+  * debian/rules: stop using debhelper, use implicit Makefile rules; use
+    dpkg-architecture instead of uname -m.
+  * debian/implicit: new; implicit rules.
+  * debian/dietlibc.conffiles: new.
+  * debian/dietlibc-dev.files, debian/dietlibc.files: remove; obsolete.
+
+ -- Gerrit Pape <pape@smarden.org>  Wed, 17 Dec 2003 20:04:54 +0000
+
+dietlibc (0.24-1) unstable; urgency=low
+
+  * new upstream version.
+  * debian/diff/cvs-20031119.diff: remove.
+  * debian/diff/make-clean.diff: new; make clean in libpthread.
+
+ -- Gerrit Pape <pape@smarden.org>  Tue, 25 Nov 2003 19:58:51 +0000
+
+dietlibc (0.23-4) unstable; urgency=low
+
+  * debian/diff/cvs-20031119.diff: new; snapshot from upstream cvs.
+  * debian/diff/ia64-assembly.diff, debian/diff/ia64-pipe.diff,
+    debian/diff/parisc-assembly.diff: remove; obsolete.
+  * debian/control: add s390 to Architectures: field of dietlibc-dev; add
+    arm to Architectures: field of dietlibc; adapt long descriptions.
+  * debian/rules: build dynamic diet libc library on arm (additionally to
+    i386); don't dh_fixperms of libdl.so only.
+
+ -- Gerrit Pape <pape@smarden.org>  Wed, 19 Nov 2003 10:36:41 +0000
+
+dietlibc (0.23-3) unstable; urgency=low
+
+  * debian/diff/ia64-assembly.diff: new; taken from upstream cvs; fixes
+    fork() on ia64.
+  * debian/diff/ia64-pipe.diff: new; fixes pipe() (thx Thomas Ogrisegg).
+  * debian/diff/parisc-assembly.diff: new; taken from upstream cvs; fixes
+    typo in setjmp.S; fixes str*.S assembly routines.
+  * debian/rules: re-enable building parisc/str*.S assembly routines.
+
+ -- Gerrit Pape <pape@smarden.org>  Mon,  3 Nov 2003 10:07:41 +0000
+
+dietlibc (0.23-2) unstable; urgency=medium
+
+  * force package re-build on arm (bug #215913, #216958).
+
+ -- Gerrit Pape <pape@smarden.org>  Thu, 23 Oct 2003 10:55:03 +0000
+
+dietlibc (0.23-1) unstable; urgency=low
+
+  * new upstream version.
+  * debian/diff/cvs-20030904.diff: remove.
+  * debian/rules: still don't build parisc/str*.S for now.
+
+ -- Gerrit Pape <pape@smarden.org>  Sat, 13 Sep 2003 09:02:31 +0000
+
+dietlibc (0.22-3cvs20030904.1) unstable; urgency=low
+
+  * debian/rules: don't build new parisc assembly routines for now (fixes
+    build failure on hppa).
+  * new cvs snapshot provides vasprintf() (closes: #192233).
+
+ -- Gerrit Pape <pape@smarden.org>  Fri,  5 Sep 2003 10:19:57 +0200
+
+dietlibc (0.22-3cvs20030904) unstable; urgency=low
+
+  * debian/diff/cvs-20030714.diff: remove.
+  * debian/diff/cvs-20030904.diff: new; new cvs snapshot.
+  * debian/diff/parisc-stat-struct.diff: remove; applied upstream.
+
+ -- Gerrit Pape <pape@smarden.org>  Thu,  4 Sep 2003 16:50:20 +0200
+
+dietlibc (0.22-3cvs20030714.1) unstable; urgency=low
+
+  * debian/diff/parisc-stat-struct.diff: new; fix 'stat struct' on parisc
+    (closes: #200619).
+  * debian/control: Standards-Version: 3.6.0.
+
+ -- Gerrit Pape <pape@smarden.org>  Tue, 19 Aug 2003 10:40:51 +0200
+
+dietlibc (0.22-3cvs20030714) unstable; urgency=low
+
+  * debian/control: package dietlibc-dev: Section: libdevel.
+  * debian/diff/cvs-20030714.diff: new; upstream cvs snapshot.
+    * fixes linker failure on sparc (closes: #200756).
+    * removes unmotivated gcc3 workaround (closes: #192936).
+  * debian/diff/rpc-int-overflow.diff: remove; included in cvs snapshot.
+  * debian/diff/mips-pic.diff: adapt to cvs snapshot changes.
+  * debian/rules: use ls -t and ls -tr when applying patches.
+
+ -- Gerrit Pape <pape@smarden.org>  Mon, 14 Jul 2003 14:26:08 +0200
+
+dietlibc (0.22-2) unstable; urgency=high
+
+  * debian/diff/rpc-int-overflow.diff: new; fix integer overflow in sun rpc
+    code (taken from upstream: taken from glibc; CA-2003-10)
+
+ -- Gerrit Pape <pape@smarden.org>  Sat, 22 Mar 2003 22:37:29 +0100
+
+dietlibc (0.22-1) unstable; urgency=low
+
+  * new upstream version.
+  * debian/diff/64bit-lseek64.diff: remove; applied upstream.
+  * debian/diff/parisc64-build.diff: remove; applied upstream.
+  * debian/diff/sparc32-sysdep.diff: remove; fixed/partly applied upstream.
+
+ -- Gerrit Pape <pape@smarden.org>  Thu, 20 Feb 2003 10:29:20 +0100
+
+dietlibc (0.22-0cvs20021128.3) unstable; urgency=low
+
+  * debian/rules: build architecture independent package in target
+    binary-indep (closes: #179403); do not install undocumented.7 symlink.
+  * debian/diff/sparc32-sysdep.diff: new; include udiv, umel, urem objects
+    in libc.a (fixes fnord build failure on sparc); libc6 also does this,
+    but generally '-msupersparc' should make this obsolete, hmm; I'm not
+    completely sure about this fix.
+  * debian/control: Standards-Version: 3.5.8
+  * debian/copyright: typo.
+
+ -- Gerrit Pape <pape@smarden.org>  Wed,  5 Feb 2003 13:00:37 +0100
+
+dietlibc (0.22-0cvs20021128.2) unstable; urgency=low
+
+  * debian/diff/64bit-lseek64.diff: new: fix lseek64 on 64-bit
+    architectures (fixes fnord build failure on ia64).
+
+ -- Gerrit Pape <pape@smarden.org>  Tue, 28 Jan 2003 11:21:43 +0100
+
+dietlibc (0.22-0cvs20021128.1) unstable; urgency=low
+
+  * i386/mmap64.S, i386/dyn_syscalls.S: from upstream cvs; fixes dynamic
+    library pic problem (thx Frank Bennett).
+  * include/signal.h: from upstream cvs.
+  * debian/diff/sparc-signal.h.diff: remove; patch is applied upstream.
+
+ -- Gerrit Pape <pape@smarden.org>  Thu,  9 Jan 2003 10:29:08 +0100
+
+dietlibc (0.22-0cvs20021128) unstable; urgency=low
+
+  * debian/diff/sparc-signal.h.diff: new; fix typo in upstream CVS
+    (fixes build failure on sparc).
+  * debian/rules: support 'debug' in DEB_BUILD_OPTIONS; minor cleanup.
+
+ -- Gerrit Pape <pape@smarden.org>  Thu, 28 Nov 2002 13:21:22 +0100
+
+dietlibc (0.22-0cvs20021127) unstable; urgency=low
+
+  * debian/control: dietlibc-doc is Section: doc.
+  * upstream cvs snapshot 20021127.
+  * debian/diff/parisc64-build.diff: new; build on parisc64.
+  * available for ia64 (please test).
+
+ -- Gerrit Pape <pape@smarden.org>  Wed, 27 Nov 2002 10:57:32 +0100
+
+dietlibc (0.21-4) unstable; urgency=low
+
+  * debian/rules: don't 'dh_fixperms' of .so libraries (closes:
+    #167846).
+
+ -- Gerrit Pape <pape@smarden.org>  Tue,  5 Nov 2002 10:58:39 +0100
+
+dietlibc (0.21-3) unstable; urgency=low
+
+  * debian/rules: add target patch, patch-stamp: apply diffs from
+    debian/diff/; apply reverse diffs in clean target.
+  * debian/diff/mips-pic.diff: new;
+    * avoid -fno-pic on mips/mipsel, libgcc.a is compiled with -fPIC on
+      Debian (thx Johannes Stezenbach).
+
+ -- Gerrit Pape <pape@smarden.org>  Wed, 30 Oct 2002 13:34:07 +0100
+
+dietlibc (0.21-2) unstable; urgency=medium
+
+  * libshell/realpath.c: include fix from upstream cvs (closes:
+    #165802).
+  * alpha/__alarm.c, syscalls.s/alarm.S, alpha/Makefile.add: include
+    fix for alarm() on alpha from upstream cvs (fixes fnord build
+    failure).
+  * include/signal.h: from upstream cvs.
+
+ -- Gerrit Pape <pape@smarden.org>  Sat, 26 Oct 2002 12:26:37 +0200
+
+dietlibc (0.21-1) unstable; urgency=low
+
+  * new upstream version.
+  * Makefile: minor patch to build the parisc port on ARCH=parisc64.
+  * available for hppa (please test).
+  * dietlibc-dev: add lintian override: statically-linked-binary.
+
+ -- Gerrit Pape <pape@smarden.org>  Wed,  9 Oct 2002 12:53:39 +0200
+
+dietlibc (0.20-0cvs20020808) unstable; urgency=medium
+
+  * new cvs snapshot: includes fix for integer overflow checks:
+    * lib/alloc.c, libstdio/fwrite.c: remove division by zero chance
+      in integer overflow check.
+
+ -- Gerrit Pape <pape@smarden.org>  Thu,  8 Aug 2002 21:46:01 +0200
+
+dietlibc (0.20-0cvs20020806) unstable; urgency=high
+
+  * new upstream version 0.19 plus security fix: add several integer
+    overflow checks from upstream cvs:
+    * lib/alloc.c, include/limits.h: fix calloc integer overflow
+      (notified by RUS-CERT).
+
+ -- Gerrit Pape <pape@smarden.org>  Wed,  7 Aug 2002 00:38:50 +0200
+
+dietlibc (0.18-1) unstable; urgency=low
+
+  * new upstream version.
+    * lib/sscanf.c: fix "%d%n" handling (closes: #147315).
+
+ -- Gerrit Pape <pape@smarden.org>  Sat, 20 Jul 2002 15:26:31 +0200
+
+dietlibc (0.17-2) unstable; urgency=low
+
+  * bugfix taken from upstream cvs (closes: #143668):
+    * libstdio/ftell.c: ftell did not take ungetc into account (Kevin
+      Ryde through Debian).
+
+ -- Gerrit Pape <pape@smarden.org>  Mon, 13 May 2002 11:14:07 +0200
+
+dietlibc (0.17-1) unstable; urgency=low
+
+  * new maintainer.
+  * new upstream version.
+  * installs into /usr/lib/diet.
+  * builds successfully on powerpc (closes: #143397).
+
+ -- Gerrit Pape <pape@smarden.org>  Mon,  6 May 2002 09:52:21 +0200
+
+dietlibc (0.16-2) unstable; urgency=low
+
+  * Changed rules script to only compile the dynamic library if
+    if it is i386 only (Closes: #141795)
+
+ -- Abraham vd Merwe <abz@debian.org>  Mon,  8 Apr 2002 18:22:15 +0200
+
+dietlibc (0.16-1) unstable; urgency=low
+
+  * New version. Sorry about this (Closes: #132315, #138338, #139223)
+  * Dynamic linking support - shaky of course
+  * S/390 (s390) support
+  * Removed README.Debian (all the questions is now covered in the
+    main FAQ)
+  * Use a slightly modified version of Felix's diet binaries instead
+    of my shell script.
+  * Probably other things which I can't remember :P
+
+ -- Abraham vd Merwe <abz@debian.org>  Fri, 22 Mar 2002 19:19:19 +0200
+
+dietlibc (0.12-2) unstable; urgency=low
+
+  * Fixed mipsel bug in Makefile.add (Closes: #125781)
+  * Changed debian rules file so that copyright can be installed
+    for architecture dependant files as well (Closes: #124152)
+
+ -- Abraham vd Merwe <abz@debian.org>  Wed, 19 Dec 2001 22:17:51 +0200
+
+dietlibc (0.12-1) unstable; urgency=low
+
+  * New upstream version
+  * I've changed debian/rules to make diet executable after
+    replacing the default diet wrappers (Closes: #120297)
+  * Added the new documents to debian/docs
+  * Added Russel Nelson's patch (posted on dietlibc-dev). Dietlibc
+    should build on ARM now (Closes: #120396)
+  * The fputc('\n',stderr) bug seems to be fixed in 0.12 (Closes: #122164)
+  * I've split the package up into three seperate packages.
+
+ -- Abraham vd Merwe <abz@debian.org>  Thu, 4 Dec 2001 22:19:07 +0200
+
+dietlibc (0.11-4) unstable; urgency=low
+
+  * Changed Makefile and debian/rules to use 'uname -m' again in order
+    to determine the architecture (Closes: #119715)
+
+ -- Abraham vd Merwe <abz@debian.org>  Thu, 15 Nov 2001 19:50:32 +0200
+
+dietlibc (0.11-3) unstable; urgency=low
+
+  * Removed the -EB flag from mips/Makefile.add. The mipsel bug should
+    hopefully now be fixed. (Closes: #109209)
+
+ -- Abraham vd Merwe <abz@debian.org>  Sat, 10 Nov 2001 11:11:09 +0200
+
+dietlibc (0.11-2) unstable; urgency=low
+
+  * Changed Makefile and debian/rules to use 'dpkg --print-architecture'
+    in order to determine the host architecture (Closes: #109209)
+  * Added a rule in debian/rules to remove backup files (Closes: #117273)
+
+ -- Abraham vd Merwe <abz@debian.org>  Mon, 29 Oct 2001 18:29:15 +0200
+
+dietlibc (0.11-1) unstable; urgency=low
+
+  * Updated README.Debian
+  * Dietlibc will now only build for all the officially supported
+    platforms (Closes: #104688)
+  * Removed preinst kernel header compatibility hack. Since the new
+    dietlibc doesn't depend on the kernel headers, this is not necessary
+    anymore.
+
+ -- Abraham vd Merwe <abz@debian.org>  Thu, 2 Aug 2001 00:16:23 +0200
+
+dietlibc (0.10-1) unstable; urgency=low
+
+  * Initial Release. (Closes: #99955)
+
+ -- Abraham vd Merwe <abz@debian.org>  Sat, 16 Jun 2001 01:06:56 +0200
+
+Local variables:
+mode: debian-changelog
+End:
--- dietlibc-0.31.orig/debian/dietlibc-dev.lintian
+++ dietlibc-0.31/debian/dietlibc-dev.lintian
@@ -0,0 +1 @@
+dietlibc-dev: statically-linked-binary
--- dietlibc-0.31.orig/debian/dietlibc-dev.prerm.in
+++ dietlibc-0.31/debian/dietlibc-dev.prerm.in
@@ -0,0 +1,5 @@
+#!/bin/sh
+set -e
+
+test "$1" = 'remove' || exit 0
+test ! -h /usr/lib/diet/lib-|ARCH| || rm -f /usr/lib/diet/lib-|ARCH|
--- dietlibc-0.31.orig/debian/rules
+++ dietlibc-0.31/debian/rules
@@ -0,0 +1,135 @@
+#!/usr/bin/make -f
+
+ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
+  DEBUG =DEBUG=1
+else
+  DEBUG =
+endif
+
+ARCH ?=$(shell dpkg-architecture -qDEB_HOST_ARCH)
+ifeq ($(ARCH),amd64)
+  ARCH =x86_64
+else
+ifeq ($(ARCH),powerpc)
+  ARCH =ppc
+else
+ifeq ($(ARCH),hppa)
+  ARCH =parisc
+else
+ifeq ($(ARCH),mipsel)
+  ARCH =mips
+endif
+endif
+endif
+endif
+
+DYN =1
+ifneq ($(ARCH),i386)
+  DYN =0
+endif
+
+DIR =$(shell pwd)/debian/dietlibc
+VERSION =$(shell head -n1 debian/changelog |sed -e 's/.*(\(.*\)).*/\1/')
+
+patch: deb-checkdir patch-stamp
+patch-stamp:
+	for i in `ls -1 debian/diff/*.diff || :`; do \
+	  patch -p1 <$$i || exit 1; \
+	done
+	touch patch-stamp
+
+build: deb-checkdir build-stamp
+build-stamp: patch-stamp 
+	$(MAKE) prefix=/usr/lib/diet \
+	  MYARCH='$(ARCH)' VERSION='$(VERSION)' $(DEBUG)
+	bin-'$(ARCH)'/diet -v -Os gcc -nostdinc -o ttt test/select.c
+	./ttt
+	rm -f ttt
+	test '$(DYN)' -eq 0 || \
+	  $(MAKE) dyn prefix=/usr/lib/diet \
+	    MYARCH='$(ARCH)' VERSION='$(VERSION)' $(DEBUG)
+	touch build-stamp
+
+clean: deb-checkdir deb-checkuid
+	-$(MAKE) clean
+	test ! -e patch-stamp || \
+	  for i in `ls -1r debian/diff/*.diff || :`; do patch -p1 -R <$$i; done
+	rm -f build-stamp install-stamp patch-stamp
+	rm -f dynlinker.README libdl.README libpthread.CHANGES \
+	  libpthread.README profiling.PORTING profiling.README \
+	  sparc64.README ia64.README changelog
+	rm -rf '$(DIR)' '$(DIR)'-dev '$(DIR)'-doc
+	rm -f debian/files debian/substvars debian/dietlibc-dev.postinst \
+	  debian/dietlibc-dev.prerm
+
+install: deb-checkdir deb-checkuid install-stamp
+install-stamp: build-stamp
+	rm -rf '$(DIR)' '$(DIR)'-dev '$(DIR)'-doc
+	install -d -m0755 '$(DIR)'/etc
+	$(MAKE) install prefix=/usr/lib/diet DESTDIR='$(DIR)' \
+	  MYARCH='$(ARCH)' VERSION='$(VERSION)' $(DEBUG)
+	# dietlibc dietlibc-dev dietlibc-doc
+	echo '/usr/lib/diet/lib' >'$(DIR)'/etc/diet.ld.conf
+	install -d -m0755 '$(DIR)'-dev/usr/include
+	mv '$(DIR)'/usr/lib/diet/include '$(DIR)'-dev/usr/include/diet
+	install -d -m0755 '$(DIR)'-dev/usr/lib/diet
+	ln -s ../../include/diet '$(DIR)'-dev/usr/lib/diet/include
+	mv '$(DIR)'/usr/lib/diet/lib-'$(ARCH)' '$(DIR)'/usr/lib/diet/lib
+	cp -pr '$(DIR)'/usr/lib/diet/lib '$(DIR)'-dev/usr/lib/diet/
+	rm -f '$(DIR)'/usr/lib/diet/lib/*.[ao]
+	rm -f '$(DIR)'-dev/usr/lib/diet/lib/*.so
+	#ln -s lib '$(DIR)'-dev/usr/lib/diet/lib-'$(ARCH)'
+	mv '$(DIR)'/usr/lib/diet/bin '$(DIR)'-dev/usr/lib/diet/
+	install -d -m0755 '$(DIR)'-dev/usr/bin
+	mv '$(DIR)'-dev/usr/lib/diet/bin/diet* '$(DIR)'-dev/usr/bin/
+	ln -s ../../../bin/diet '$(DIR)'-dev/usr/lib/diet/bin/
+	if test '$(DYN)' -eq 1; then \
+	  ln -s ../../../bin/diet-dyn '$(DIR)'-dev/usr/lib/diet/bin/ && \
+	  chmod 0644 '$(DIR)'/usr/lib/diet/lib/*.so && \
+	  chmod 0755 '$(DIR)'/usr/lib/diet/lib/libdl.so; \
+	fi
+	install -d -m0755 $(DIR)-dev/usr/share/man
+	mv $(DIR)/usr/lib/diet/man/man? $(DIR)-dev/usr/share/man/
+	gzip -9 $(DIR)-dev/usr/share/man/man?/*
+	rmdir $(DIR)/usr/lib/diet/man
+	install -d -m0755 $(DIR)-doc
+	# .in
+	sed -e 's/|ARCH|/$(ARCH)/g' <debian/dietlibc-dev.postinst.in \
+	  >debian/dietlibc-dev.postinst
+	sed -e 's/|ARCH|/$(ARCH)/g' <debian/dietlibc-dev.prerm.in \
+	  >debian/dietlibc-dev.prerm
+	# lintian overrides
+	install -d -m0755 '$(DIR)'-dev/usr/share/lintian/overrides
+	install -m0644 debian/dietlibc-dev.lintian \
+	  '$(DIR)'-dev/usr/share/lintian/overrides/dietlibc-dev
+	# doc
+	rm -f dynlinker.README libdl.README libpthread.CHANGES \
+	  libpthread.README profiling.PORTING profiling.README \
+	  sparc64.README ia64.README changelog
+	ln -s dynlinker/README dynlinker.README
+	ln -s libdl/README libdl.README
+	ln -s libpthread/CHANGES libpthread.CHANGES
+	ln -s libpthread/README libpthread.README
+	ln -s profiling/PORTING profiling.PORTING
+	ln -s profiling/README profiling.README
+	ln -s sparc64/README sparc64.README
+	ln -s ia64/README ia64.README
+	ln -s CHANGES changelog
+	touch install-stamp
+
+binary-indep: deb-checkdir deb-checkuid install dietlibc-doc.deb
+	dpkg-gencontrol -isp -pdietlibc-doc -P'$(DIR)'-doc
+	dpkg -b '$(DIR)'-doc ..
+
+binary-arch: deb-checkdir deb-checkuid install dietlibc-dev.deb dietlibc.deb
+	dpkg-gencontrol -isp -pdietlibc-dev -P'$(DIR)'-dev
+	dpkg -b '$(DIR)'-dev ..
+	if test '$(DYN)' -eq 1; then \
+	  dpkg-gencontrol -isp -pdietlibc -P'$(DIR)'; \
+	  dpkg -b '$(DIR)' ..; \
+	fi
+
+binary: binary-indep binary-arch
+.PHONY: patch build clean install binary-indep binary-arch binary
+
+include debian/implicit
--- dietlibc-0.31.orig/debian/dietlibc-dev.postinst.in
+++ dietlibc-0.31/debian/dietlibc-dev.postinst.in
@@ -0,0 +1,31 @@
+#!/bin/sh
+set -e
+
+test "$1" = 'configure' || exit 0
+test ! -h /usr/lib/diet/lib-|ARCH| || exit 0
+
+err() {
+  >&2 cat <<-EOT
+
+	$1 exists in /usr/lib/diet/lib/ and /usr/lib/diet/lib-|ARCH|/.
+	Debian installs diet compiled libraries in /usr/lib/diet/lib/.
+
+	Please remove /usr/lib/diet/lib-|ARCH|/$1, and reinstall the
+	package.
+
+	EOT
+  exit 1
+}
+
+if test -d /usr/lib/diet/lib-|ARCH|; then
+  for i in `ls -1a /usr/lib/diet/lib-|ARCH|/`; do
+    test "$i" != '.' || continue; test "$i" != '..' || continue
+    test ! -e /usr/lib/diet/lib/"$i" || err "$i"
+  done
+  for i in `ls -1a /usr/lib/diet/lib-|ARCH|/`; do
+    test "$i" != '.' || continue; test "$i" != '..' || continue
+    mv /usr/lib/diet/lib-|ARCH|/"$i" /usr/lib/diet/lib/"$i" || exit 1
+  done
+  rmdir /usr/lib/diet/lib-|ARCH|
+fi
+ln -s lib /usr/lib/diet/lib-|ARCH|
--- dietlibc-0.31.orig/debian/dietlibc-doc.docs
+++ dietlibc-0.31/debian/dietlibc-doc.docs
@@ -0,0 +1,18 @@
+AUTHOR
+BUGS
+CAVEAT
+FAQ
+PORTING
+README
+README.security
+SECURITY
+THANKS
+TODO
+dynlinker.README
+libdl.README
+libpthread.CHANGES
+libpthread.README
+profiling.PORTING
+profiling.README
+sparc64.README
+ia64.README
--- dietlibc-0.31.orig/debian/diff/0004-Do-not-clobber-HOME-environment-variable.diff
+++ dietlibc-0.31/debian/diff/0004-Do-not-clobber-HOME-environment-variable.diff
@@ -0,0 +1,68 @@
+From a558a292e8efc06103a09977110708d847e1e1a1 Mon Sep 17 00:00:00 2001
+From: Ted Percival <ted@midg3t.net>
+Date: Thu, 3 May 2007 09:19:07 +0000
+Subject: [PATCH] Do not clobber HOME environment variable.
+
+To: Debian Bug Tracking System <submit@bugs.debian.org>
+Date: Tue, 17 Oct 2006 21:57:23 +1000
+
+During the build of dietlibc the Makefile clobbers the HOME environment
+variable for the duration of the build. The HOME environment variable
+is used by ccontrol to find its configuration file, but when building
+dietlibc it can't find its configuration and fails to execute properly.
+
+Here is a snippet of the build output when using ccontrol:
+> /usr/bin/make prefix=/usr/lib/diet \
+>           MYARCH='i386' VERSION='0.30-1'
+> make[1]: Entering directory `/tmp/dietlibc-0.30'
+> mkdir bin-i386
+> gcc -I. -isystem include -pipe -nostdinc -Os -fomit-frame-pointer
+> -falign-functions=1 -falign-jumps=1 -falign-loops=1
+> -mpreferred-stack-boundary=2 -Wall -W -Wchar-subscripts
+> -Wmissing-prototypes -Wmissing-declarations -Wno-switch -Wno-unused
+> -Wredundant-decls -c i386/start.S -o bin-i386/start.o
+> ccontrol error: reading /tmp/dietlibc-0.30/.ccontrol/config: 2
+> make[1]: *** [bin-i386/start.o] Error 1
+
+I propose changing the variable name in the Makefile to "DIETHOME" in
+order to fix this. A patch to do so is attached.
+
+-Ted
+---
+ Makefile |    6 +++---
+ 1 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index fc5062f..5795e33 100644
+--- a/Makefile
++++ b/Makefile
+@@ -86,7 +86,7 @@ endif
+ OBJDIR=bin-$(ARCH)
+ ILIBDIR=$(LIBDIR)-$(ARCH)
+ 
+-HOME=$(shell pwd)
++DIETHOME=$(shell pwd)
+ 
+ WHAT=	$(OBJDIR) $(OBJDIR)/start.o $(OBJDIR)/dyn_start.o $(OBJDIR)/dyn_stop.o \
+ 	$(OBJDIR)/dietlibc.a $(OBJDIR)/liblatin1.a \
+@@ -304,7 +304,7 @@ VERSION=dietlibc-$(shell head -n 1 CHANGES|sed 's/://')
+ CURNAME=$(notdir $(shell pwd))
+ 
+ $(OBJDIR)/diet: $(OBJDIR)/start.o $(OBJDIR)/dyn_start.o diet.c $(OBJDIR)/dietlibc.a $(OBJDIR)/dyn_stop.o
+-	$(CROSS)$(CC) -isystem include $(CFLAGS) -nostdlib -o $@ $^ -DDIETHOME=\"$(HOME)\" -DVERSION=\"$(VERSION)\" -lgcc
++	$(CROSS)$(CC) -isystem include $(CFLAGS) -nostdlib -o $@ $^ -DDIETHOME=\"$(DIETHOME)\" -DVERSION=\"$(VERSION)\" -lgcc
+ 	$(CROSS)strip -R .comment -R .note $@
+ 
+ $(OBJDIR)/diet-i: $(OBJDIR)/start.o $(OBJDIR)/dyn_start.o diet.c $(OBJDIR)/dietlibc.a $(OBJDIR)/dyn_stop.o
+@@ -312,7 +312,7 @@ $(OBJDIR)/diet-i: $(OBJDIR)/start.o $(OBJDIR)/dyn_start.o diet.c $(OBJDIR)/dietl
+ 	$(CROSS)strip -R .comment -R .note $@
+ 
+ $(PICODIR)/diet-dyn: $(PICODIR)/start.o $(PICODIR)/dyn_start.o diet.c
+-	$(LD_UNSET) $(CROSS)$(CC) -isystem include $(CFLAGS) -fPIC -nostdlib -o $@ $^ -DDIETHOME=\"$(HOME)\" -D__DYN_LIB -DVERSION=\"$(VERSION)\" -L$(PICODIR) -lc -lgcc $(PICODIR)/dyn_stop.o -Wl,-dynamic-linker=$(HOME)/$(PICODIR)/libdl.so
++	$(LD_UNSET) $(CROSS)$(CC) -isystem include $(CFLAGS) -fPIC -nostdlib -o $@ $^ -DDIETHOME=\"$(DIETHOME)\" -D__DYN_LIB -DVERSION=\"$(VERSION)\" -L$(PICODIR) -lc -lgcc $(PICODIR)/dyn_stop.o -Wl,-dynamic-linker=$(DIETHOME)/$(PICODIR)/libdl.so
+ 	$(CROSS)strip -R .command -R .note $@
+ 
+ $(PICODIR)/diet-dyn-i: $(PICODIR)/start.o $(PICODIR)/dyn_start.o diet.c
+-- 
+1.5.3.GIT
+
--- dietlibc-0.31.orig/debian/diff/0006-parisc-clone.S-fix-build-failure-on-hppa.diff
+++ dietlibc-0.31/debian/diff/0006-parisc-clone.S-fix-build-failure-on-hppa.diff
@@ -0,0 +1,28 @@
+From 542654e0027f6426bc7ecae5925c4c7ef11e0cb4 Mon Sep 17 00:00:00 2001
+From: Gerrit Pape <pape@smarden.org>
+Date: Thu, 3 May 2007 09:22:24 +0000
+Subject: [PATCH] parisc/clone.S: fix build failure on hppa.
+
+gcc -I. -isystem include -pipe -nostdinc -Os -fomit-frame-pointer -Wall -W -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -Wno-switch -Wno-unused -Wredundant-decls -c parisc/clone.S -o bin-parisc/clone.o
+parisc/clone.S: Assembler messages:
+parisc/clone.S:40: Error: Invalid operands
+make[1]: *** [bin-parisc/clone.o] Error 1
+make[1]: Leaving directory `/home/pape/dietlibc'
+make: *** [build-stamp] Error 2
+---
+ parisc/clone.S |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/parisc/clone.S b/parisc/clone.S
+index 2846f3b..b504673 100644
+--- a/parisc/clone.S
++++ b/parisc/clone.S
+@@ -37,4 +37,4 @@ __clone:
+ 	bl	_exit,%r2		/* exit thread */
+ 	copy	%r28,%r26		/* return -> arg0 */
+ 
+-	iitlbp	%r0,(%r0)		/* DIE ! DIE ! */
++	iitlbp	%r0,(%sr0,%r0)		/* DIE ! DIE ! */
+-- 
+1.5.3.GIT
+
--- dietlibc-0.31.orig/debian/diff/0001-fflush-NULL-don-t-flush-input-streams-stdin.diff
+++ dietlibc-0.31/debian/diff/0001-fflush-NULL-don-t-flush-input-streams-stdin.diff
@@ -0,0 +1,25 @@
+From e198261270884913834dc11b1a356384acc93ec4 Mon Sep 17 00:00:00 2001
+From: Gerrit Pape <pape@smarden.org>
+Date: Thu, 3 May 2007 09:08:02 +0000
+Subject: [PATCH] fflush(NULL): don't flush input streams (stdin).
+
+See http://bugs.debian.org/346437
+---
+ libstdio/fflush.c |    1 -
+ 1 files changed, 0 insertions(+), 1 deletions(-)
+
+diff --git a/libstdio/fflush.c b/libstdio/fflush.c
+index d65125c..cf68ad7 100644
+--- a/libstdio/fflush.c
++++ b/libstdio/fflush.c
+@@ -17,7 +17,6 @@ int fflush_unlocked(FILE *stream) {
+   if (stream==0) {
+     int res;
+     FILE *f;
+-    __fflush_stdin();
+     __fflush_stdout();
+     __fflush_stderr();
+     for (res=0, f=__stdio_root; f; f=f->next)
+-- 
+1.5.3.GIT
+
--- dietlibc-0.31.orig/debian/diff/0005-Don-t-define-WANT_SSP.diff
+++ dietlibc-0.31/debian/diff/0005-Don-t-define-WANT_SSP.diff
@@ -0,0 +1,27 @@
+From 2069f6dc00d97bc69eb217ab2628a0fb9acc76be Mon Sep 17 00:00:00 2001
+From: Gerrit Pape <pape@smarden.org>
+Date: Thu, 3 May 2007 09:21:13 +0000
+Subject: [PATCH] Don't define WANT_SSP.
+
+It causes similar problems as WANT_STACKGAP back in Dec 2004, see
+http://bug.debian.org/374349
+---
+ dietfeatures.h |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/dietfeatures.h b/dietfeatures.h
+index 70e2175..c6b6e80 100644
+--- a/dietfeatures.h
++++ b/dietfeatures.h
+@@ -115,7 +115,7 @@
+  * WANT_SSP_URANDOM and then not using -fstack-protector enlarges a
+  * binary by 152 bytes. */
+ #if (__GNUC__>4) || ((__GNUC__==4) && (__GNUC_MINOR__>=1))
+-#define WANT_SSP
++/* #define WANT_SSP */
+ #endif
+ /* Choose which canary seeder you want you can choose
+  * both but it will check urandom first and use xor as
+-- 
+1.5.3.GIT
+
--- dietlibc-0.31.orig/debian/diff/0010-util-vserver-vsched-fails-to-read-config-directory.diff
+++ dietlibc-0.31/debian/diff/0010-util-vserver-vsched-fails-to-read-config-directory.diff
@@ -0,0 +1,50 @@
+From 195934b76a4bf8b8b22ee6dc9d95cb98f55d8d9d Mon Sep 17 00:00:00 2001
+From: Gerrit Pape <pape@smarden.org>
+Date: Sun, 26 Aug 2007 09:37:32 +0000
+Subject: [PATCH] util-vserver: vsched fails to read config directory
+
+Jan H Eringa wrote:
+> Use of /etc/vservers/<vserver name>/sched/.... causes vsched to blow up
+> |my-server# vsched --xid 40000 --dir /etc/vservers/test-1/sched
+> |vsched: readdir(): Bad address
+>
+>
+> Which I suspect is the cause of....
+> |my-server# /etc/init.d/util-vserver start
+> |Fixing visibility of /proc entries for Linux-VServer guests...readdir():
+> Bad
+>  address
+> |readdir(): Bad address
+[...]
+
+This is due to dietlibc not properly aligning the buffer it's handing to
+sys_readdir. Check your dmesg output, and it should say something like
+Kernel unaligned access at TPC[4b7268] filldir64+0x70/0x134
+
+http://people.linux-vserver.org/~dhozac/p/m/delta-dietdirent-fix01.diff
+fixes it, but you'll have to rebuild util-vserver as well after applying
+that patch to dietlibc.
+
+--
+Daniel Hokka Zakrisson
+---
+ dietdirent.h |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/dietdirent.h b/dietdirent.h
+index dbd7206..487d5a9 100644
+--- a/dietdirent.h
++++ b/dietdirent.h
+@@ -1,8 +1,8 @@
+ #include <sys/shm.h>
+ 
+ struct __dirstream {
+-  int fd;
+   char buf[PAGE_SIZE-(sizeof (int)*3)];
++  int fd;
+   unsigned int num;
+   unsigned int cur;
+ };				/* stream data from opendir() */
+-- 
+1.5.3.GIT
+
--- dietlibc-0.31.orig/debian/diff/0007-semctl.S-semget.S-semop.s-for-parisc.diff
+++ dietlibc-0.31/debian/diff/0007-semctl.S-semget.S-semop.s-for-parisc.diff
@@ -0,0 +1,49 @@
+From de13dc79a63d2f34f31bcb8c25bfe99ff9fc10d1 Mon Sep 17 00:00:00 2001
+From: Gerrit Pape <pape@smarden.org>
+Date: Thu, 3 May 2007 09:25:24 +0000
+Subject: [PATCH] semctl.S, semget.S, semop.s for parisc.
+
+On hppa, the semctl, semget, and semop functions were unavailable. Trying
+to use them results in
+> undefined reference to `__ipc'
+when linking. This can be seen in the ccontrol build log:
+<http://buildd.debian.org/fetch.cgi?pkg=ccontrol;ver=0.9.1%2B20060806-2;arch=hppa;stamp=1160949237>
+---
+ parisc/semctl.S |    3 +++
+ parisc/semget.S |    3 +++
+ parisc/semop.S  |    3 +++
+ 3 files changed, 9 insertions(+), 0 deletions(-)
+ create mode 100644 parisc/semctl.S
+ create mode 100644 parisc/semget.S
+ create mode 100644 parisc/semop.S
+
+diff --git a/parisc/semctl.S b/parisc/semctl.S
+new file mode 100644
+index 0000000..e215ed9
+--- /dev/null
++++ b/parisc/semctl.S
+@@ -0,0 +1,3 @@
++#include "syscalls.h"
++
++syscall(semctl,semctl)
+diff --git a/parisc/semget.S b/parisc/semget.S
+new file mode 100644
+index 0000000..67f4885
+--- /dev/null
++++ b/parisc/semget.S
+@@ -0,0 +1,3 @@
++#include "syscalls.h"
++
++syscall(semget,semget)
+diff --git a/parisc/semop.S b/parisc/semop.S
+new file mode 100644
+index 0000000..81b6fc6
+--- /dev/null
++++ b/parisc/semop.S
+@@ -0,0 +1,3 @@
++#include "syscalls.h"
++
++syscall(semop,semop)
+-- 
+1.5.3.GIT
+
--- dietlibc-0.31.orig/debian/diff/0009-workaround-Bug-428814-powerpc-error-initializer-e.diff
+++ dietlibc-0.31/debian/diff/0009-workaround-Bug-428814-powerpc-error-initializer-e.diff
@@ -0,0 +1,70 @@
+From eb45f517c01f2817dd87b6ba9b3a7986e0334d2a Mon Sep 17 00:00:00 2001
+From: Gerrit Pape <pape@smarden.org>
+Date: Mon, 2 Jul 2007 09:58:14 +0000
+Subject: [PATCH] workaround Bug#428814: [powerpc] error: initializer element is not constant
+
+On Sat, Jun 30, 2007 at 11:24:15AM +0200, Matthias Klose wrote:
+> Gerrit Pape writes:
+> > On Thu, Jun 14, 2007 at 02:27:49PM +0200, Falk Hueffner wrote:
+> > > Gerrit Pape <pape@dbnbgs.smarden.org> writes:
+> > > > On a current Debian/powerpc sid system:
+> > > >
+> > > >  $ cat >ttt.c <<EOT
+> > > >  static const double d[] = { 1.0l/6/1/2, -1.0l/30/3/4 };
+> > > >  int main() { return 0; }
+> > > >  EOT
+> > > >  $ gcc-4.1 ttt.c
+> > > >  ttt.c:1: error: initializer element is not constant
+> > > >  ttt.c:1: error: (near initialization for 'd[0]')
+> > > >  ttt.c:1: error: initializer element is not constant
+> > > >  ttt.c:1: error: (near initialization for 'd[1]')
+> > >
+> > > This is http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26374
+> >
+> > The dietlibc FTBFS because of this.
+> >
+> > gcc-4.2 4.2-20070627-1 has the same problem, is there a workaround?
+>
+> make the initializer double precision for now?
+---
+ libm/gamma.c |   17 +++++++++++++++++
+ 1 files changed, 17 insertions(+), 0 deletions(-)
+
+diff --git a/libm/gamma.c b/libm/gamma.c
+index 9682f35..c0017b3 100644
+--- a/libm/gamma.c
++++ b/libm/gamma.c
+@@ -33,6 +33,22 @@ Return value    gamma returns a value in range (-0.1208, +oo). For a input
+ #include <stdlib.h>
+ #include <math.h>
+ 
++#if defined(__powerpc__)
++/* workaround #428814 */
++#define B0      +            1.0/   6/ 1/ 2
++#define B1      -            1.0/  30/ 3/ 4
++#define B2      +            1.0/  42/ 5/ 6
++#define B3      -            1.0/  30/ 7/ 8
++#define B4      +            5.0/  66/ 9/10
++#define B5      -          691.0/2730/11/12
++#define B6      +            7.0/   6/13/14
++#define B7      -         3617.0/ 510/15/16
++#define B8      +        43867.0/ 798/17/18
++#define B9      -       174611.0/ 330/19/20
++#define B10     +       854513.0/ 138/21/22
++#define B11     -    236364091.0/2730/23/24
++#define B12     +      8553103.0/   6/25/26
++#else
+ #define B0      +            1.0l/   6/ 1/ 2
+ #define B1      -            1.0l/  30/ 3/ 4
+ #define B2      +            1.0l/  42/ 5/ 6
+@@ -46,6 +62,7 @@ Return value    gamma returns a value in range (-0.1208, +oo). For a input
+ #define B10     +       854513.0l/ 138/21/22
+ #define B11     -    236364091.0l/2730/23/24
+ #define B12     +      8553103.0l/   6/25/26
++#endif
+ 
+ static const double  coeff[] = { B0, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10 };
+ int                  signgam;
+-- 
+1.5.3.GIT
+
--- dietlibc-0.31.orig/debian/diff/0002-Avoid-fno-pic-on-mips-mipsel-libgcc.a-is-compiled-w.diff
+++ dietlibc-0.31/debian/diff/0002-Avoid-fno-pic-on-mips-mipsel-libgcc.a-is-compiled-w.diff
@@ -0,0 +1,39 @@
+From 5d08c995cdfee2d80e485f43058a387c4e03e403 Mon Sep 17 00:00:00 2001
+From: Gerrit Pape <pape@smarden.org>
+Date: Thu, 3 May 2007 09:13:51 +0000
+Subject: [PATCH] Avoid -fno-pic on mips/mipsel, libgcc.a is compiled with -fPIC on Debian.
+
+(thx Johannes Stezenbach).
+---
+ diet.c            |    2 +-
+ mips/Makefile.add |    2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/diet.c b/diet.c
+index 9864a2c..f5fc672 100644
+--- a/diet.c
++++ b/diet.c
+@@ -33,7 +33,7 @@ static const char* Os[] = {
+   "sparc64","-Os","-m64","-mhard-quad-float",0,
+   "alpha","-Os","-fomit-frame-pointer",0,
+   "arm","-Os","-fomit-frame-pointer",0,
+-  "mips","-Os","-fomit-frame-pointer","-mno-abicalls","-fno-pic","-G","0",0,
++  "mips","-Os","-fomit-frame-pointer",0,
+   "mipsel","-Os","-fomit-frame-pointer","-mno-abicalls","-fno-pic","-G","0",0,
+   "ppc","-Os","-fomit-frame-pointer","-mpowerpc-gpopt","-mpowerpc-gfxopt",0,
+   "ppc64","-Os","-fomit-frame-pointer","-mpowerpc-gpopt","-mpowerpc-gfxopt",0,
+diff --git a/mips/Makefile.add b/mips/Makefile.add
+index 35d9aa3..0b59d04 100644
+--- a/mips/Makefile.add
++++ b/mips/Makefile.add
+@@ -9,6 +9,6 @@
+ ifeq ($(CROSS),mips-linux-)
+ ENDIAN=-meb
+ endif
+-CFLAGS+=$(ENDIAN) -Os -G 0 -fstrict-aliasing -fno-pic -mno-abicalls
++CFLAGS+=$(ENDIAN) -Os -fstrict-aliasing
+ VPATH:=mips:syscalls.s:$(VPATH)
+ LIBOBJ+=$(OBJDIR)/pread64.o $(OBJDIR)/pwrite64.o $(OBJDIR)/divdi3.o
+-- 
+1.5.3.GIT
+
--- dietlibc-0.31.orig/debian/diff/0008-Use-syscall-_newselect-instead-of-select-on-ppc.diff
+++ dietlibc-0.31/debian/diff/0008-Use-syscall-_newselect-instead-of-select-on-ppc.diff
@@ -0,0 +1,23 @@
+From b1d5312b3d67114dab42b498d5d7e942eecd2f24 Mon Sep 17 00:00:00 2001
+From: Gerrit Pape <pape@smarden.org>
+Date: Thu, 3 May 2007 09:26:55 +0000
+Subject: [PATCH] Use syscall _newselect instead of select on ppc.
+
+See http://bugs.debian.org/394928
+---
+ ppc/select.S |    3 +++
+ 1 files changed, 3 insertions(+), 0 deletions(-)
+ create mode 100644 ppc/select.S
+
+diff --git a/ppc/select.S b/ppc/select.S
+new file mode 100644
+index 0000000..6f86351
+--- /dev/null
++++ b/ppc/select.S
+@@ -0,0 +1,3 @@
++#include "syscalls.h"
++
++syscall(_newselect,select)
+-- 
+1.5.3.GIT
+
--- dietlibc-0.31.orig/debian/diff/0003-nice-set-errno-EPERM-on-error.diff
+++ dietlibc-0.31/debian/diff/0003-nice-set-errno-EPERM-on-error.diff
@@ -0,0 +1,33 @@
+From 6c0293ca01b80a2392272ab28ac487c90c678dc7 Mon Sep 17 00:00:00 2001
+From: Gerrit Pape <pape@smarden.org>
+Date: Thu, 3 May 2007 09:17:24 +0000
+Subject: [PATCH] nice(): set errno=EPERM on error.
+
+See http://bugs.debian.org/286825
+---
+ lib/__nice.c |    7 ++++++-
+ 1 files changed, 6 insertions(+), 1 deletions(-)
+
+diff --git a/lib/__nice.c b/lib/__nice.c
+index d751104..28581d9 100644
+--- a/lib/__nice.c
++++ b/lib/__nice.c
+@@ -1,9 +1,14 @@
+ #include "syscalls.h"
+ #include <sys/time.h>
+ #include <sys/resource.h>
++#include <errno.h>
+ 
+ #ifndef __NR_nice
+ int nice(int i) {
+-  return setpriority(PRIO_PROCESS,0,getpriority(PRIO_PROCESS,0)+i);
++  if (setpriority(PRIO_PROCESS,0,getpriority(PRIO_PROCESS,0)+i) == -1) {
++    errno=EPERM;
++    return -1;
++  }
++  return getpriority(PRIO_PROCESS,0);
+ }
+ #endif
+-- 
+1.5.3.GIT
+
--- dietlibc-0.31.orig/debian/diff/0011-undefined-symbol-umount2-alpha-ia64.diff
+++ dietlibc-0.31/debian/diff/0011-undefined-symbol-umount2-alpha-ia64.diff
@@ -0,0 +1,79 @@
+From 0f4be8919707fd8bbb0005667f0705f4169696d3 Mon Sep 17 00:00:00 2001
+From: Simon McVittie <smcv@debian.org>
+Date: Sat, 3 Jan 2009 12:04:48 +0000
+Subject: [PATCH] Add new #defines to indicate which syscall is umount(3) and which is umount2(3).
+
+* on architectures where __NR_umount is umount(3) and __NR_umount2 is
+  umount2(3), don't do anything special
+* on architectures where this is not the case, define __NR_umount_with_flags
+  so that it's umount2(3)
+* define __NR_umount_without_flags to be umount(3) on architectures where
+  such a syscall exists
+
+In the currently-supported architectures there are four families:
+
+* on i386, arm etc., __NR_umount takes one argument and __NR_umount2 takes two
+* on x86_64 and parisc __NR_umount2 takes two arguments and there is no
+  1-argument umount
+* on alpha, __NR_oldumount takes one argument and __NR_umount takes two
+* on ia64, __NR_umount takes two arguments and there is no 1-argument umount
+---
+ alpha/syscalls.h     |    2 ++
+ ia64/syscalls.h      |    1 +
+ syscalls.s/umount.S  |    4 ++++
+ syscalls.s/umount2.S |    4 +++-
+ 4 files changed, 10 insertions(+), 1 deletions(-)
+
+diff --git a/alpha/syscalls.h b/alpha/syscalls.h
+index c40a81c..7a78209 100644
+--- a/alpha/syscalls.h
++++ b/alpha/syscalls.h
+@@ -381,6 +381,8 @@
+ #define __NR_inotify_add_watch		445
+ #define __NR_inotify_rm_watch		446
+ 
++#define __NR_umount_without_flags __NR_oldumount
++#define __NR_umount_with_flags __NR_umount
+ 
+ #define syscall_weak(name,wsym,sym) \
+ .text ; \
+diff --git a/ia64/syscalls.h b/ia64/syscalls.h
+index 515242c..e41433a 100644
+--- a/ia64/syscalls.h
++++ b/ia64/syscalls.h
+@@ -280,6 +280,7 @@
+ #define __NR_tee			1301
+ #define __NR_vmsplice			1302
+ 
++#define __NR_umount_with_flags __NR_umount
+ 
+ #define syscall(name, sym) \
+ .text; \
+diff --git a/syscalls.s/umount.S b/syscalls.s/umount.S
+index 4a423d9..89793e2 100644
+--- a/syscalls.s/umount.S
++++ b/syscalls.s/umount.S
+@@ -1,3 +1,7 @@
+ #include "syscalls.h"
+ 
++#if defined(__NR_umount_without_flags)
++syscall(umount_without_flags,umount)
++#elif !defined(__NR_umount_with_flags) || (__NR_umount != __NR_umount_with_flags)
+ syscall(umount,umount)
++#endif
+diff --git a/syscalls.s/umount2.S b/syscalls.s/umount2.S
+index b27b353..5742416 100644
+--- a/syscalls.s/umount2.S
++++ b/syscalls.s/umount2.S
+@@ -1,5 +1,7 @@
+ #include "syscalls.h"
+ 
+-#ifdef __NR_umount2
++#if defined(__NR_umount_with_flags)
++syscall(umount_with_flags,umount2)
++#elif defined(__NR_umount2)
+ syscall(umount2,umount2)
+ #endif
+-- 
+1.5.6.5
+
--- dietlibc-0.31.orig/debian/diff/0012-Add-an-implementation-of-umount-3-for-ia64.diff
+++ dietlibc-0.31/debian/diff/0012-Add-an-implementation-of-umount-3-for-ia64.diff
@@ -0,0 +1,36 @@
+From b5ffca4c796763829c55df3da9e83fe4052db042 Mon Sep 17 00:00:00 2001
+From: Simon McVittie <smcv@debian.org>
+Date: Sat, 3 Jan 2009 12:11:42 +0000
+Subject: [PATCH] Add an implementation of umount(3) for ia64
+
+Like x86_64 and parisc, ia64 lacks a single-argument umount syscall, so we
+need to provide a stub implementation that just calls umount2(path, 0).
+I don't know ia64 assembler, so this one is in C.
+---
+ ia64/Makefile.add     |    2 +-
+ ia64/umount-wrapper.c |    5 +++++
+ 2 files changed, 6 insertions(+), 1 deletions(-)
+ create mode 100644 ia64/umount-wrapper.c
+
+diff --git a/ia64/Makefile.add b/ia64/Makefile.add
+index f660930..ca00e4d 100644
+--- a/ia64/Makefile.add
++++ b/ia64/Makefile.add
+@@ -1,2 +1,2 @@
+ VPATH:=ia64:syscalls.s:$(VPATH)
+-LIBOBJ+=$(OBJDIR)/__time.o $(OBJDIR)/__waitpid.o $(OBJDIR)/__nice.o $(OBJDIR)/__alarm.o
++LIBOBJ+=$(OBJDIR)/__time.o $(OBJDIR)/__waitpid.o $(OBJDIR)/__nice.o $(OBJDIR)/__alarm.o $(OBJDIR)/umount-wrapper.o
+diff --git a/ia64/umount-wrapper.c b/ia64/umount-wrapper.c
+new file mode 100644
+index 0000000..2ebffd6
+--- /dev/null
++++ b/ia64/umount-wrapper.c
+@@ -0,0 +1,5 @@
++#include <sys/mount.h>
++
++int umount(const char *target) {
++  return umount2(target, 0);
++}
+-- 
+1.5.6.5
+
