summaryrefslogtreecommitdiffstats
path: root/13.0
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2009-06-22 22:59:11 +0000
committer Eric Hameleers <alien@slackware.com>2009-06-22 22:59:11 +0000
commit5e7a8f474c4572d89508ad0770b1e8ce57715614 (patch)
tree743f2ddc581698d200aa5c38110487fa506c5645 /13.0
parent1a65a135396a1aaa939070df2ed92f6f558ea210 (diff)
downloadmultilib-5e7a8f474c4572d89508ad0770b1e8ce57715614.tar.gz
multilib-5e7a8f474c4572d89508ad0770b1e8ce57715614.tar.xz
Initial revision
Diffstat (limited to '13.0')
-rwxr-xr-x13.0/glibc/glibc-multilib.SlackBuild526
-rw-r--r--13.0/glibc/glibc.pthread-disable-forced-unwind-check.diff207
2 files changed, 733 insertions, 0 deletions
diff --git a/13.0/glibc/glibc-multilib.SlackBuild b/13.0/glibc/glibc-multilib.SlackBuild
new file mode 100755
index 0000000..bd94b99
--- /dev/null
+++ b/13.0/glibc/glibc-multilib.SlackBuild
@@ -0,0 +1,526 @@
+#!/bin/sh
+
+# Copyright 2006, 2008, 2009 Patrick J. Volkerding, Sebeka, MN, USA
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+## build glibc-$VERSION for Slackware, including 32-bit compatibility libraries
+
+# Extended to build 32-bit compatibility libraries on x86_64,
+# by Fred Emmott <mail@fredemmott.co.uk>. No copyright claim.
+# Simplified to produce combined packages (no separate compat-32),
+# by Eric Hameleers <alien@slackware.com>
+
+
+VERSION=${VERSION:-2.9}
+CHECKOUT=${CHECKOUT:--20090316}
+BUILD=${BUILD:-3alien}
+# $ARCH may be preset, otherwise i486 compatibility with i686 binary
+# structuring is the Slackware default, since this is what gcc-3.2+
+# requires for binary compatibility with previous releases.
+ARCH=${ARCH:-x86_64}
+
+CVSVER=${VERSION}${CHECKOUT}
+
+# If we bootstrap the multilib glibc with a non-multilib version installed,
+# we need to do some things differently:
+if echo "$*" | grep -wq -- "--bootstrap" ; then
+ echo "**"
+ echo "** Bootstrap build"
+ echo "**"
+ BOOTSTRP=1
+else
+ BOOTSTRP=0
+fi
+
+# NOTE!!! glibc needs to be built against the sanitized kernel headers,
+# which will be installed under /usr/include by the kernel-headers package.
+# Be sure the correct version of the headers package is installed BEFORE
+# building glibc!
+
+CWD=$(pwd)
+# Temporary build location. This should not be a directory
+# path a non-root user could create later...
+TMP=${TMP:-/glibc-tmp-$(mcookie)}
+mkdir -p $TMP
+
+# Sanity check on the version number in the install scripts:
+if ! grep -vq libutil-$VERSION}.so $CWD/doinst.sh-glibc ; then
+ echo "FATAL: doinst.sh scripts have wrong version numbers."
+ exit 1
+fi
+
+case $ARCH in
+ x86_64)
+ TARGET=${TARGET:-x86_64}
+ TARGET32=${TARGET32:-i486}
+ ;;
+ i486)
+ # This should be i486 for all 32-bit x86 arch:
+ TARGET=${TARGET:-i486}
+ ;;
+esac
+
+# This function fixes a doinst.sh file for x86_64.
+# With thanks to Fred Emmott.
+fix_doinst() {
+ if [ "x$LIBDIRSUFFIX" = "x" ]; then
+ return;
+ fi;
+ # Fix "( cd usr/lib ;" occurrences
+ sed -i "s#lib ;#lib${LIBDIRSUFFIX} ;#" install/doinst.sh
+ # Fix "lib/" occurrences
+ sed -i "s#lib/#lib${LIBDIRSUFFIX}/#g" install/doinst.sh
+ # Fix "( cd lib" occurrences
+ sed -i "s#( cd lib\$#( cd lib${LIBDIRSUFFIX}#" install/doinst.sh
+
+ if [ "$ARCH" = "x86_64" ]; then
+ sed -i 's#ld-linux.so.2#ld-linux-x86-64.so.2#' install/doinst.sh
+ fi
+}
+
+# This is a patch function to put all glibc patches in the build script
+# up near the top.
+apply_patches() {
+ # Use old-style locale directories rather than a single (and strangely
+ # formatted) /usr/lib/locale/locale-archive file:
+ zcat $CWD/glibc.locale.no-archive.diff.gz | patch -p1 --verbose || exit 1
+ # The is_IS locale is causing a strange error about the "echn" command
+ # not existing. This patch reverts is_IS to the version shipped in
+ # glibc-2.5:
+ zcat $CWD/is_IS.diff.gz | patch -p1 --verbose || exit 1
+ # Fix NIS netgroups:
+ zcat $CWD/glibc.nis-netgroups.diff.gz | patch -p1 --verbose || exit 1
+ # Support ru_RU.CP1251 locale:
+ zcat $CWD/glibc.ru_RU.CP1251.diff.gz | patch -p1 --verbose || exit 1
+ # Fix missing MAX macro in getcwd.c:
+ zcat $CWD/glibc.getcwd.max.macro.diff.gz | patch -p1 --verbose || exit 1
+ # Fix resolver problem with glibc-2.9:
+ zcat $CWD/glibc-2.10-dns-no-gethostbyname4.diff.gz | patch -p0 --verbose || exit 1
+ # This reverts a patch that was made to glibc to fix "namespace leakage",
+ # which seems to cause some build failures (e.g. with conntrack):
+ zcat $CWD/glibc.revert.to.fix.build.breakages.diff.gz | patch -p1 --verbose || exit 1
+ if [ $BOOTSTRP -eq 1 ] ; then
+ # Multilib - Disable check for forced unwind (Patch from eglibc) since we
+ # do not have a multilib glibc yet to link to;
+ zcat $CWD/glibc.pthread-disable-forced-unwind-check.diff.gz | patch -p1 --verbose || exit 1
+ fi
+ # Update the timezone information.
+ ( cd timezone
+ tar xzf $CWD/tzdata2009d.tar.gz
+ chown root:root *
+ mv yearistype.sh yearistype
+ chmod 644 *
+ chmod 755 yearistype
+ mkdir tzcode
+ cd tzcode
+ tar xzf $CWD/tzcode2009d.tar.gz
+ chown -R root:root .
+ chmod 644 *
+ cp -a *.c *.h ..
+ )
+}
+
+# I'll break this out as an option for fun :-)
+case $ARCH in
+ i486)
+ OPTIMIZ="-O3 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
+ ;;
+ i586)
+ OPTIMIZ="-O3 -march=i586"
+ LIBDIRSUFFIX=""
+ ;;
+ i686)
+ OPTIMIZ="-O3 -march=i686"
+ LIBDIRSUFFIX=""
+ ;;
+ athlon)
+ OPTIMIZ="-O3 -march=athlon"
+ LIBDIRSUFFIX=""
+ ;;
+ s390)
+ OPTIMIZ="-O3"
+ LIBDIRSUFFIX=""
+ ;;
+ x86_64)
+ OPTIMIZ="-O3 -fPIC"
+ LIBDIRSUFFIX="64"
+ ;;
+ *)
+ OPTIMIZ="-O3"
+ LIBDIRSUFFIX=""
+ ;;
+esac
+
+# This is going to be the initial $DESTDIR:
+export PKG=$TMP/package-glibc-incoming-tree
+PGLIBC=$TMP/package-glibc
+PSOLIBS=$TMP/package-glibc-solibs
+PZONE=$TMP/package-glibc-zoneinfo
+PI18N=$TMP/package-glibc-i18n
+PPROFILE=$TMP/package-glibc-profile
+PDEBUG=$TMP/package-glibc-debug
+
+# Empty these locations first:
+for dir in $PKG $PGLIBC $PSOLIBS $PZONE $PI18N $PPROFILE $PDEBUG ; do
+ if [ -d $dir ]; then
+ rm -rf $dir
+ fi
+ mkdir -p $dir
+done
+if [ -d $TMP/glibc-$VERSION ]; then
+ rm -rf $TMP/glibc-$VERSION
+fi
+
+# Create an incoming directory structure for glibc to be built into:
+mkdir -p $PKG/lib${LIBDIRSUFFIX}
+mkdir -p $PKG/sbin
+mkdir -p $PKG/usr/bin
+mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}
+mkdir -p $PKG/usr/sbin
+mkdir -p $PKG/usr/include
+mkdir -p $PKG/usr/doc
+mkdir -p $PKG/usr/man
+mkdir -p $PKG/usr/share
+mkdir -p $PKG/var/db/nscd
+mkdir -p $PKG/var/run/nscd
+
+# Begin extract/compile:
+cd $TMP
+rm -rf glibc-$CVSVER
+tar xjvf $CWD/glibc-$CVSVER.tar.bz2
+cd glibc-$CVSVER
+
+# If we use this script to bootstrap a multilib glibc using a bare
+# statically compiled gcc, we need to disable linking to libgcc_eh:
+if [ $BOOTSTRP -eq 1 ] ; then
+ sed -i -e 's/-lgcc_eh//g' Makeconfig
+fi
+
+chown -R root:root .
+find . -perm 666 -exec chmod 644 {} \;
+find . -perm 664 -exec chmod 644 {} \;
+find . -perm 600 -exec chmod 644 {} \;
+find . -perm 444 -exec chmod 644 {} \;
+find . -perm 400 -exec chmod 644 {} \;
+find . -perm 440 -exec chmod 644 {} \;
+find . -perm 777 -exec chmod 755 {} \;
+find . -perm 775 -exec chmod 755 {} \;
+find . -perm 511 -exec chmod 755 {} \;
+find . -perm 711 -exec chmod 755 {} \;
+find . -perm 555 -exec chmod 755 {} \;
+
+# Clean up leftover CVS directories:
+find . -type d -name CVS -exec rm -r {} \; 2> /dev/null
+
+# Apply patches; exit if any fail.
+apply_patches
+if [ ! $? = 0 ]; then
+ exit 1
+fi
+
+build_glibc() {
+ CFLAGS="-g $OPTIMIZ -I/usr/include" \
+ ../configure \
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --enable-kernel=2.6.18 \
+ --with-headers=/usr/include \
+ --enable-add-ons=libidn,nptl \
+ --enable-profile \
+ --infodir=/usr/info \
+ --mandir=/usr/man \
+ --with-tls \
+ --with-__thread \
+ --without-cvs \
+ $TARGET-slackware-linux
+
+ make -j4 || exit 1
+ make install install_root=$PKG || exit 1
+ make localedata/install-locales install_root=$PKG || exit 1
+}
+
+# Build the 32-bit binaries first,
+# so that 64-bit stuff overwrites the 32-bit stuff where appropriate:
+if [ "x$LIBDIRSUFFIX" = "x64" ]; then
+ echo "BUILDING DAS 32-BiT NPTL GLIBC"
+ (
+ mkdir build-glibc-compat32-$VERSION
+ cd build-glibc-compat32-$VERSION
+ export BUILD_ARCH=$TARGET
+ export TARGET=$TARGET32
+ export LIBDIRSUFFIX=
+ export CC="gcc -m32"
+ export OPTIMIZ="-O3 -march=i486 -mtune=i686"
+ build_glibc
+ )
+fi
+
+# Make build directory:
+
+mkdir build-glibc-$VERSION
+cd build-glibc-$VERSION
+
+echo "BUILDING DAS NPTL GLIBC"
+build_glibc
+
+# The prevailing standard seems to be putting unstripped libraries in
+# /usr/lib/debug/ and stripping the debugging symbols from all the other
+# libraries.
+mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/debug
+cp -a $PKG/lib${LIBDIRSUFFIX}/l*.so* $PKG/usr/lib${LIBDIRSUFFIX}/debug
+cp -a $PKG/usr/lib${LIBDIRSUFFIX}/*.a $PKG/usr/lib${LIBDIRSUFFIX}/debug
+# Don't need debug+profile:
+( cd $PKG/usr/lib${LIBDIRSUFFIX}/debug ; rm -f *_p.* )
+# NOTE: Is there really a reason for the glibc-debug package?
+# If you're debugging glibc, you can also compile it, right?
+
+## COMMENTED OUT: There's no reason for profile libs to include -g information.
+## Put back unstripped profiling libraries:
+#mv $PKG/usr/lib${LIBDIRSUFFIX}/debug/*_p.a $PKG/usr/lib${LIBDIRSUFFIX}
+# It might be best to put the unstripped and profiling libraries in glibc-debug and glibc-profile.
+
+# I don't think "strip -g" causes the pthread problems. It's --strip-unneeded that does.
+strip -g $PKG/lib${LIBDIRSUFFIX}/l*.so*
+strip -g $PKG/usr/lib${LIBDIRSUFFIX}/l*.so*
+strip -g $PKG/usr/lib${LIBDIRSUFFIX}/lib*.a
+
+# Back to the sources dir to add some files/docs:
+cd $TMP/glibc-$CVSVER
+
+# We'll automatically install the config file for the Name Server Cache Daemon.
+# Perhaps this should also have some commented-out startup code in rc.inet2...
+mkdir -p $PKG/etc
+cat nscd/nscd.conf > $PKG/etc/nscd.conf.new
+
+# Install some scripts to help select a timezone:
+mkdir -p $PKG/var/log/setup
+cp -a $CWD/timezone-scripts/setup.timeconfig $PKG/var/log/setup
+chown root:root $PKG/var/log/setup/setup.timeconfig
+chmod 755 $PKG/var/log/setup/setup.timeconfig
+mkdir -p $PKG/usr/sbin
+cp -a $CWD/timezone-scripts/timeconfig $PKG/usr/sbin
+chown root:root $PKG/usr/sbin/timeconfig
+chmod 755 $PKG/usr/sbin/timeconfig
+
+## Install docs:
+( mkdir -p $PKG/usr/doc/glibc-$VERSION
+ cp -a \
+ BUGS CONFORMANCE COPYING COPYING.LIB FAQ INSTALL LICENSES NAMESPACE \
+ NEWS NOTES PROJECTS README README.libm \
+ $PKG/usr/doc/glibc-$VERSION
+
+ # Add the SlackBuild:
+ cat $0 > $PKG/usr/doc/glibc-$VERSION/gcc-static.SlackBuild
+ chmod 644 $PKG/usr/doc/glibc-$VERSION/gcc-static.SlackBuild
+)
+
+# Don't forget to add the /usr/share/zoneinfo/localtime -> /etc/localtime symlink! :)
+if [ ! -r $PKG/usr/share/zoneinfo/localtime ]; then
+ ( cd $PKG/usr/share/zoneinfo ; ln -sf /etc/localtime . )
+fi
+
+# OK, there are some very old Linux standards that say that any binaries in a /bin or
+# /sbin directory (and the directories themselves) should be group bin rather than
+# group root, unless a specific group is really needed for some reason.
+#
+# I can't find any mention of this in more recent standards docs, and always thought
+# that it was pretty cosmetic anyway (hey, if there's a reason -- fill me in!), so
+# it's possible that this ownership change won't be followed in the near future
+# (it's a PITA, and causes many bug reports when the perms change is occasionally
+# forgotten).
+#
+# But, it's hard to get me to break old habits, so we'll continue the tradition here:
+#
+# No, no we won't. You know how we love to break traditions.
+
+# Strip most binaries:
+( cd $PKG
+ find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-debug 2> /dev/null
+ find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip -g 2> /dev/null
+)
+
+# Fix info dir:
+rm $PKG/usr/info/dir
+gzip -9 $PKG/usr/info/*
+
+# This is junk
+rm $PKG/etc/ld.so.cache
+( cd $PKG
+ find . -name "*.orig" -exec rm {} \;
+)
+
+##################################
+# OK, time to make some packages #
+##################################
+
+# glibc-zoneinfo. We will start with an easy one to avoid breaking a sweat ;-)
+cd $PZONE
+# Install some scripts to help select a timezone:
+mkdir -p $PZONE/var/log/setup
+cp -a $CWD/timezone-scripts/setup.timeconfig $PZONE/var/log/setup
+chown root:root $PZONE/var/log/setup/setup.timeconfig
+chmod 755 $PZONE/var/log/setup/setup.timeconfig
+mkdir -p $PZONE/usr/sbin
+cp -a $CWD/timezone-scripts/timeconfig $PZONE/usr/sbin
+chown root:root $PZONE/usr/sbin/timeconfig
+chmod 755 $PZONE/usr/sbin/timeconfig
+mkdir $PZONE/install
+cat $CWD/doinst.sh-glibc-zoneinfo > $PZONE/install/doinst.sh
+cat $CWD/slack-desc.glibc-zoneinfo > $PZONE/install/slack-desc
+mkdir -p $PZONE/usr/share
+cd $PZONE/usr/share
+cp -a --verbose $PKG/usr/share/zoneinfo .
+cd $PZONE
+mkdir -p $PZONE/etc
+# This is already hard-coded into doinst.sh (like it'll be there anyway ;-):
+rm -f etc/localtime
+# Wrap it up:
+makepkg -l y -c n $TMP/glibc-zoneinfo-${VERSION}_multilib-noarch-$BUILD.txz
+
+# glibc-profile:
+cd $PPROFILE
+mkdir -p usr/lib${LIBDIRSUFFIX}
+# Might as well just grab these with 'mv' to simplify things later:
+mv $PKG/usr/lib${LIBDIRSUFFIX}/lib*_p.a usr/lib${LIBDIRSUFFIX}
+# Profile libs should be stripped. Use the debug libs to debug...
+( cd usr/lib${LIBDIRSUFFIX} ; strip -g *.a )
+if [ "x$LIBDIRSUFFIX" = "x64" ]; then
+ # Same exercise for the lib dir:
+ mkdir -p usr/lib
+ mv $PKG/usr/lib/lib*_p.a usr/lib
+ ( cd usr/lib ; strip -g *.a )
+fi
+mkdir install
+cp -a $CWD/slack-desc.glibc-profile install/slack-desc
+makepkg -l y -c n $TMP/glibc-profile-${VERSION}_multilib-$ARCH-$BUILD.txz
+
+# THIS IS NO LONGER PACKAGED (or is it? might be better to let it be made, and then ship it or not...)
+# glibc-debug:
+cd $PDEBUG
+mkdir -p usr/lib${LIBDIRSUFFIX}
+# Might as well just grab these with 'mv' to simplify things later:
+mv $PKG/usr/lib${LIBDIRSUFFIX}/debug usr/lib${LIBDIRSUFFIX}
+if [ "x$LIBDIRSUFFIX" = "x64" ]; then
+ # Same exercise for lib:
+ mkdir -p usr/lib
+ mv $PKG/usr/lib/debug usr/lib
+fi
+mkdir install
+cp -a $CWD/slack-desc.glibc-debug install/slack-desc
+makepkg -l y -c n $TMP/glibc-debug-${VERSION}_multilib-$ARCH-$BUILD.txz
+## INSTEAD, NUKE THESE LIBS
+#rm -rf $PKG/usr/lib${LIBDIRSUFFIX}/debug
+
+# glibc-i18n:
+cd $PI18N
+mkdir -p usr/lib${LIBDIRSUFFIX}
+rm -rf usr/lib${LIBDIRSUFFIX}/locale
+cp -a $PKG/usr/lib${LIBDIRSUFFIX}/locale usr/lib${LIBDIRSUFFIX}
+if [ "x$LIBDIRSUFFIX" = "x64" ]; then
+ # Same exercise for lib:
+ mkdir -p usr/lib
+ rm -rf usr/lib/locale
+ cp -a $PKG/usr/lib/locale usr/lib
+fi
+mkdir -p usr/share
+cp -a $PKG/usr/share/i18n usr/share
+cp -a $PKG/usr/share/locale usr/share
+mkdir install
+cp -a $CWD/slack-desc.glibc-i18n install/slack-desc
+makepkg -l y -c n $TMP/glibc-i18n-${VERSION}_multilib-$ARCH-$BUILD.txz
+
+# glibc-solibs:
+cd $PSOLIBS
+mkdir -p etc/profile.d
+cp -a $CWD/profile.d/* etc/profile.d
+chown -R root:root etc
+chmod 755 etc/profile.d/*
+mkdir -p lib${LIBDIRSUFFIX}
+cp -a $PKG/lib${LIBDIRSUFFIX}/* lib${LIBDIRSUFFIX}
+( cd lib${LIBDIRSUFFIX}
+ mkdir incoming
+ mv *so* incoming
+ mv incoming/libSegFault.so .
+)
+if [ "x$LIBDIRSUFFIX" = "x64" ]; then
+ # Same exercise for lib:
+ mkdir -p lib
+ cp -a $PKG/lib/* lib
+fi
+mkdir -p usr
+cp -a $PKG/usr/bin usr
+mv usr/bin/ldd .
+rm usr/bin/*
+mv ldd usr/bin
+mkdir -p usr/lib${LIBDIRSUFFIX}
+# The gconv directory has a lot of stuff, but including it here will save some problems.
+# Seems standard elsewhere.
+cp -a $PKG/usr/lib${LIBDIRSUFFIX}/gconv usr/lib${LIBDIRSUFFIX}
+if [ "x$LIBDIRSUFFIX" = "x64" ]; then
+ # Same exercise for lib:
+ mkdir -p usr/lib
+ cp -a $PKG/usr/lib/gconv usr/lib
+fi
+# Another manpage abandoned by GNU...
+#mkdir -p usr/man/man1
+#cp -a $PKG/usr/man/man1/ldd.1.gz usr/man/man1
+mkdir -p usr/libexec
+cp -a $PKG/usr/libexec/pt_chown usr/libexec
+# Same usr.bin deal:
+cp -a $PKG/sbin .
+mv sbin/ldconfig .
+rm sbin/*
+mv ldconfig sbin
+mkdir install
+cp -a $CWD/slack-desc.glibc-solibs install/slack-desc
+cp -a $CWD/doinst.sh-glibc-solibs install/doinst.sh
+fix_doinst
+# Ditch links:
+find . -type l -exec rm {} \;
+# Build the package:
+makepkg -l y -c n $TMP/glibc-solibs-${VERSION}_multilib-$ARCH-$BUILD.txz
+
+# And finally, the complete "all-in-one" glibc package is created
+# from whatever was leftover:
+cd $PGLIBC
+mv $PKG/* .
+mkdir -p etc/profile.d
+cp -a $CWD/profile.d/* etc/profile.d
+chown -R root:root etc
+chmod 755 etc/profile.d/*
+# Ditch links (these are in doinst.sh-glibc):
+find . -type l -exec rm {} \;
+mkdir install
+cp -a $CWD/slack-desc.glibc install/slack-desc
+cp -a $CWD/doinst.sh-glibc install/doinst.sh
+fix_doinst
+( cd lib${LIBDIRSUFFIX}
+ mkdir incoming
+ mv *so* incoming
+ mv incoming/libSegFault.so .
+)
+# Build the package:
+makepkg -l y -c n $TMP/glibc-${VERSION}_multilib-$ARCH-$BUILD.txz
+
+# Done!
+echo
+echo "glibc packages built in $TMP!"
+
diff --git a/13.0/glibc/glibc.pthread-disable-forced-unwind-check.diff b/13.0/glibc/glibc.pthread-disable-forced-unwind-check.diff
new file mode 100644
index 0000000..f779844
--- /dev/null
+++ b/13.0/glibc/glibc.pthread-disable-forced-unwind-check.diff
@@ -0,0 +1,207 @@
+diff -Naur glibc-2.7/nptl/sysdeps/pthread/configure glibc-2.7-unwind/nptl/sysdeps/pthread/configure
+--- glibc-2.7/nptl/sysdeps/pthread/configure 2007-10-18 11:22:23.000000000 +0000
++++ glibc-2.7-unwind/nptl/sysdeps/pthread/configure 2008-03-30 16:53:42.000000000 +0000
+@@ -24,130 +24,9 @@
+ fi
+
+
+-{ echo "$as_me:$LINENO: checking for forced unwind support" >&5
+-echo $ECHO_N "checking for forced unwind support... $ECHO_C" >&6; }
+-if test "${libc_cv_forced_unwind+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
+-else
+- cat >conftest.$ac_ext <<_ACEOF
+-/* confdefs.h. */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h. */
+-#include <unwind.h>
+-int
+-main ()
+-{
+-
+-struct _Unwind_Exception exc;
+-struct _Unwind_Context *context;
+-_Unwind_GetCFA (context)
+- ;
+- return 0;
+-}
+-_ACEOF
+-rm -f conftest.$ac_objext conftest$ac_exeext
+-if { (ac_try="$ac_link"
+-case "(($ac_try" in
+- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+- *) ac_try_echo=$ac_try;;
+-esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+- (eval "$ac_link") 2>conftest.er1
+- ac_status=$?
+- grep -v '^ *+' conftest.er1 >conftest.err
+- rm -f conftest.er1
+- cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } && {
+- test -z "$ac_c_werror_flag" ||
+- test ! -s conftest.err
+- } && test -s conftest$ac_exeext &&
+- $as_test_x conftest$ac_exeext; then
+ libc_cv_forced_unwind=yes
+-else
+- echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
+-
+- libc_cv_forced_unwind=no
+-fi
+-
+-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+- conftest$ac_exeext conftest.$ac_ext
+-fi
+-{ echo "$as_me:$LINENO: result: $libc_cv_forced_unwind" >&5
+-echo "${ECHO_T}$libc_cv_forced_unwind" >&6; }
+-if test $libc_cv_forced_unwind = yes; then
+ cat >>confdefs.h <<\_ACEOF
+ #define HAVE_FORCED_UNWIND 1
+ _ACEOF
+
+- old_CFLAGS="$CFLAGS"
+- CFLAGS="$CFLAGS -Werror -fexceptions"
+- { echo "$as_me:$LINENO: checking for C cleanup handling" >&5
+-echo $ECHO_N "checking for C cleanup handling... $ECHO_C" >&6; }
+-if test "${libc_cv_c_cleanup+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
+-else
+- cat >conftest.$ac_ext <<_ACEOF
+-/* confdefs.h. */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h. */
+-
+-#include <stdio.h>
+-void cl (void *a) { }
+-int
+-main ()
+-{
+-
+- int a __attribute__ ((cleanup (cl)));
+- puts ("test")
+- ;
+- return 0;
+-}
+-_ACEOF
+-rm -f conftest.$ac_objext conftest$ac_exeext
+-if { (ac_try="$ac_link"
+-case "(($ac_try" in
+- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+- *) ac_try_echo=$ac_try;;
+-esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+- (eval "$ac_link") 2>conftest.er1
+- ac_status=$?
+- grep -v '^ *+' conftest.er1 >conftest.err
+- rm -f conftest.er1
+- cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } && {
+- test -z "$ac_c_werror_flag" ||
+- test ! -s conftest.err
+- } && test -s conftest$ac_exeext &&
+- $as_test_x conftest$ac_exeext; then
+ libc_cv_c_cleanup=yes
+-else
+- echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
+-
+- libc_cv_c_cleanup=no
+-fi
+-
+-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+- conftest$ac_exeext conftest.$ac_ext
+-fi
+-{ echo "$as_me:$LINENO: result: $libc_cv_c_cleanup" >&5
+-echo "${ECHO_T}$libc_cv_c_cleanup" >&6; }
+- CFLAGS="$old_CFLAGS"
+- if test $libc_cv_c_cleanup = no; then
+- { { echo "$as_me:$LINENO: error: the compiler must support C cleanup handling" >&5
+-echo "$as_me: error: the compiler must support C cleanup handling" >&2;}
+- { (exit 1); exit 1; }; }
+- fi
+-else
+- { { echo "$as_me:$LINENO: error: forced unwind support is required" >&5
+-echo "$as_me: error: forced unwind support is required" >&2;}
+- { (exit 1); exit 1; }; }
+-fi
+diff -Naur glibc-2.7/nptl/sysdeps/pthread/configure.in glibc-2.7-unwind/nptl/sysdeps/pthread/configure.in
+--- glibc-2.7/nptl/sysdeps/pthread/configure.in 2003-12-03 06:50:01.000000000 +0000
++++ glibc-2.7-unwind/nptl/sysdeps/pthread/configure.in 2008-03-30 16:54:50.000000000 +0000
+@@ -19,31 +19,41 @@
+ esac
+ fi
+
+-dnl Iff <unwind.h> is available, make sure it is the right one and it
+-dnl contains struct _Unwind_Exception.
+-AC_CACHE_CHECK(dnl
+-for forced unwind support, libc_cv_forced_unwind, [dnl
+-AC_TRY_LINK([#include <unwind.h>], [
+-struct _Unwind_Exception exc;
+-struct _Unwind_Context *context;
+-_Unwind_GetCFA (context)],
+-libc_cv_forced_unwind=yes, libc_cv_forced_unwind=no)])
+-if test $libc_cv_forced_unwind = yes; then
+- AC_DEFINE(HAVE_FORCED_UNWIND)
+-dnl Check for C cleanup handling.
+- old_CFLAGS="$CFLAGS"
+- CFLAGS="$CFLAGS -Werror -fexceptions"
+- AC_CACHE_CHECK([for C cleanup handling], libc_cv_c_cleanup, [dnl
+- AC_TRY_LINK([
+-#include <stdio.h>
+-void cl (void *a) { }], [
+- int a __attribute__ ((cleanup (cl)));
+- puts ("test")],
+-libc_cv_c_cleanup=yes, libc_cv_c_cleanup=no)])
+- CFLAGS="$old_CFLAGS"
+- if test $libc_cv_c_cleanup = no; then
+- AC_MSG_ERROR([the compiler must support C cleanup handling])
+- fi
+-else
+- AC_MSG_ERROR(forced unwind support is required)
+-fi
++dnl These link tests made bootstrapping EGLIBC difficult (how do you
++dnl link if you haven't built a libc yet?), and this test is only used
++dnl to produce an error message anyway. We've already checked the
++dnl GCC, as, and ld versions in the top-level configure script, and we
++dnl only use the results of these tests to produce an error message,
++dnl so we just disable these tests entirely.
++dnl
++dnl dnl Iff <unwind.h> is available, make sure it is the right one and it
++dnl dnl contains struct _Unwind_Exception.
++dnl AC_CACHE_CHECK(dnl
++dnl for forced unwind support, libc_cv_forced_unwind, [dnl
++dnl AC_TRY_LINK([#include <unwind.h>], [
++dnl struct _Unwind_Exception exc;
++dnl struct _Unwind_Context *context;
++dnl _Unwind_GetCFA (context)],
++dnl libc_cv_forced_unwind=yes, libc_cv_forced_unwind=no)])
++dnl if test $libc_cv_forced_unwind = yes; then
++dnl AC_DEFINE(HAVE_FORCED_UNWIND)
++dnl dnl Check for C cleanup handling.
++dnl old_CFLAGS="$CFLAGS"
++dnl CFLAGS="$CFLAGS -Werror -fexceptions"
++dnl AC_CACHE_CHECK([for C cleanup handling], libc_cv_c_cleanup, [dnl
++dnl AC_TRY_LINK([
++dnl #include <stdio.h>
++dnl void cl (void *a) { }], [
++dnl int a __attribute__ ((cleanup (cl)));
++dnl puts ("test")],
++dnl libc_cv_c_cleanup=yes, libc_cv_c_cleanup=no)])
++dnl CFLAGS="$old_CFLAGS"
++dnl if test $libc_cv_c_cleanup = no; then
++dnl AC_MSG_ERROR([the compiler must support C cleanup handling])
++dnl fi
++dnl else
++dnl AC_MSG_ERROR(forced unwind support is required)
++dnl fi
++libc_cv_forced_unwind=yes
++AC_DEFINE(HAVE_FORCED_UNWIND)
++libc_cv_c_cleanup=yes